forked from alerque/freecheck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example_check.ps
1056 lines (893 loc) · 23.7 KB
/
example_check.ps
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%!PS-Adobe-3.0
%%Title: FreeCheck
%%LanguageLevel: 2
%%EndComments
%%BeginProlog
/inch {72 mul} def
/PrintCheckBody {true} def
/LogoHeight {0.6 inch} def
/MemoLineHeight {0.25} def
/PayeeLineHeight {0.60} def
/Routing (R123456780R) def
/SignatureLineHeight {0.25} def
/CheckHeight {2.83 inch} def
/OnUs (S4232268154PSCCCC) def
/TransitSymbol (A) def
/LeftMargin {0.20 inch} def
/NumPages {1} def
/MICRFontSize {12} def
/MICRHorTweak {0} def
/Fraction (37-5678/1234) def
/OnUsSymbol (C) def
/DashSymbol (D) def
/CheckNumFontName /Helvetica-Bold def
/BankCityStateZip (Anytown, USA 12345) def
/StandardFontSize {9} def
/DateLineHeight {0.75} def
/Name1 (JOHN SMITH) def
/Name2 (MARY SMITH) def
/CheckVerOffset {2.50 inch} def
/CheckNumDigits {4} def
/CheckLayout /Original def
/LineWidth {0.3} def
/AmountSymbol (B) def
/LogoBorder {0.0312 inch} def
/TopMargin {0.20 inch} def
/CityStateZip (Anytown, USA 12345) def
/PrintVOID {false} def
/LogoPadding {0.0625 inch} def
/BankInfoHeight {0.45} def
/MICRFontName /GnuMICR def
/CheckHorOffset {2.50 inch} def
/BankAddr1 (6780 Main Street) def
/AmountLineHeight {0.50} def
/BankAddr2 (Suite 45) def
/PhoneNumber (512-555-1212) def
/PrintMICRLine {true} def
/StandardFontName /AvantGarde-Book def
/Address1 (1234 Main Street) def
/Address2 () def
/BankName (MegaCorp Bank, NA) def
/AuxOnUs () def
/CheckWidth {6.00 inch} def
/CheckNumber {196} def
/ChecksPerPage {3} def
/MICRVerTweak {0} def
/RightMargin {0.25 inch} def
/CheckNumFontSize {14} def
/LogoWidth {0.7 inch} def
% This is the main body of the postscript file, that acts on all of the
% definitions we got from the config file.
% Available Check Layouts
/CheckLayoutDict <<
/Original { DrawOriginalCheckBody }
/QStandard { DrawQStandardCheckBody }
/QWallet { DrawQWalletCheckBody }
>> def
% Other Constants:
% Size of the rectangular box for the amount (digits)
/AmountBoxWidth {1 inch} def
/AmountBoxHeight {0.25 inch} def
% Max number of digits in check number, and allocate string
/CheckNumDigits 4 def
/CheckNumberString CheckNumber log floor 1 add cvi string def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Helpful Printing Routines %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Shows a line, then does a "carriage return / line feed"
% But only if the string exists (more than 0 chars)
% (How do we get the current font size (height)?)
/ShowAndCR {
% if
dup length 0 gt % First copy
{
dup show % Second copy
stringwidth pop neg 0 rmoveto % Original copy & move back
neg 0 exch rmoveto % line down
}
% else
{
pop % discard (string)
pop % discard height
}
ifelse
} def
%%BeginProcSet: substitute
%%Creator: James Klicman <[email protected]>
%%CreationDate: October 2002
%%Version: 0.3
%
% (string) (O) (N) substitute -
%
% example: (A?C) (?) (B) substitute -> (ABC)
%
/substitute {
0 get exch 0 get exch % convert (O) and (N) to char codes
0 % counter
3 index % (string) {} forall
{
% ^ (string) O N counter C
3 index % (O)[0]
eq % (string)[i] == (O)[0]
{
% ^ (string) O N counter
3 index % (string)
% ^ (string) O N counter (string)
1 index % counter
% ^ (string) O N counter (string) counter
3 index % N
% ^ (string) O N counter (string) counter N
put % (string) counter N put
} if
1 add % increment counter
} forall
pop % counter
pop % N
pop % O
pop % (string)
} def
%%EndProcSet
% Fix up the MICR line components (replace placeholders with MICR
% characters)
% Argh... surely there's a better way - anyone? use "forall?"
/FixMICR {
/CheckNumStart -1 def
/CheckNumEnd -1 def
/CheckNumInOnUs false def
/CheckNumInAuxOnUs false def
% Get starting and ending positions for check number in
% (Aux)OnUs field
% (This will break if check number is entered in both fields)
OnUs length 1 sub -1 0 {
dup % dups the index
OnUs exch get (C) 0 get eq {
/CheckNumInOnUs true def
% If end number not yet defined, define it
CheckNumEnd 0 lt {
/CheckNumEnd exch def
} {
/CheckNumStart exch def
} ifelse
} {
pop
} ifelse
} for
AuxOnUs length 1 sub -1 0 {
dup % dups the index
AuxOnUs exch get (C) 0 get eq {
/CheckNumInAuxOnUs true def
% If end number not yet defined, define it
CheckNumEnd 0 lt {
/CheckNumEnd exch def
} {
/CheckNumStart exch def
} ifelse
} {
pop
} ifelse
} for
% Replace "R" in routing number with actual transit number symbol
% That's it - should be no spaces, dashes, or anything but digits
Routing (R) TransitSymbol substitute
% Replace "S" with space character in AuxOnUs
AuxOnUs (S) ( ) substitute
% Replace "-" with dash character in AuxOnUs
AuxOnUs (-) DashSymbol substitute
% Replace "P" with OnUs character in AuxOnUs
AuxOnUs (P) OnUsSymbol substitute
% Replace "S" with space character in OnUs
OnUs (S) ( ) substitute
% Replace "-" with dash character in OnUs
OnUs (-) DashSymbol substitute
% Replace "P" with OnUs character in OnUs
OnUs (P) OnUsSymbol substitute
} def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Original Feature Printing Routines %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/DrawMemoLine {
LeftMargin MemoLineHeight CheckHeight mul moveto
2.5 inch 0 inch rlineto
-2.5 inch 0 inch rmoveto
0 2 rmoveto
(for) show
} def
/DrawSignatureLine { % Expects height of signature line
% and right edge of check for
% beginning position
CheckWidth SignatureLineHeight CheckHeight mul moveto
RightMargin neg 0 rmoveto
-2.5 inch 0 rmoveto
2.5 inch 0 inch rlineto
} def
/DrawAmountLine {
CheckWidth AmountLineHeight CheckHeight mul moveto
RightMargin neg 0 rmoveto
(DOLLARS) stringwidth pop neg 0 rmoveto
(DOLLARS) show
(DOLLARS) stringwidth pop neg 0 rmoveto
-2 0 rmoveto
LeftMargin AmountLineHeight CheckHeight mul lineto
} def
/DrawAccountHolderInfo {
LeftMargin CheckHeight moveto
0 TopMargin neg rmoveto
0 StandardFontSize neg rmoveto
% make room for Logo if specified
/LogoForm where {
pop % discard dict
LogoWidth
/LogoBorder where {
pop % discard dict
LogoBorder 2 div add
} if
/LogoPadding where {
pop % discard dict
LogoPadding 2 div add
} if
0 rmoveto
} if
StandardFontSize Name1 ShowAndCR
StandardFontSize Name2 ShowAndCR
StandardFontName findfont
StandardFontSize 1 sub scalefont
setfont
StandardFontSize 1 sub Address1 ShowAndCR
StandardFontSize 1 sub Address2 ShowAndCR
StandardFontSize 1 sub CityStateZip ShowAndCR
StandardFontSize 1 sub PhoneNumber ShowAndCR
StandardFontName findfont
StandardFontSize 1 add scalefont
setfont
} def
/DrawDateLine {
0.6 CheckWidth mul DateLineHeight CheckHeight mul moveto
(Date) show
1 inch 0 rlineto
} def
/DrawBankInfo {
LeftMargin BankInfoHeight CheckHeight mul moveto
StandardFontSize BankName ShowAndCR
StandardFontName findfont
StandardFontSize 1 sub scalefont
setfont
StandardFontSize 1 sub BankAddr1 ShowAndCR
StandardFontSize 1 sub BankAddr2 ShowAndCR
StandardFontSize 1 sub BankCityStateZip ShowAndCR
StandardFontName findfont
StandardFontSize 1 add scalefont
setfont
} def
/DrawPayeeLine {
LeftMargin PayeeLineHeight CheckHeight mul moveto
(ORDER OF) show
(ORDER OF) stringwidth pop neg StandardFontSize rmoveto
(PAY TO THE) show
0 StandardFontSize neg rmoveto
4 0 rmoveto
currentpoint mark
CheckWidth PayeeLineHeight CheckHeight mul moveto
RightMargin neg 0 rmoveto
AmountBoxWidth neg 0 rmoveto
0 AmountBoxHeight rlineto
AmountBoxWidth 0 rlineto
0 AmountBoxHeight neg rlineto
AmountBoxWidth neg 0 rlineto
-4 0 rmoveto
/Helvetica-Bold findfont
14 scalefont
setfont
($) stringwidth pop neg 0 rmoveto
($) show
($) stringwidth pop neg 0 rmoveto
-4 0 rmoveto
cleartomark
lineto
StandardFontName findfont
StandardFontSize scalefont
setfont
} def
/DrawCheckNumber {
CheckWidth CheckHeight moveto
RightMargin neg TopMargin neg rmoveto
CheckNumFontName findfont
CheckNumFontSize scalefont
setfont
CheckNumberString stringwidth pop neg 0 rmoveto
0 -14 rmoveto
CheckNumberString show
StandardFontName findfont
StandardFontSize scalefont
setfont
} def
/DrawFraction {
0.6 CheckWidth mul CheckHeight moveto
0 TopMargin neg rmoveto
0 StandardFontSize neg rmoveto
Fraction show
} def
/DrawStub {
CheckHorOffset 2 inch ge {
save
newpath
CheckHorOffset neg 0 translate
StandardFontName findfont
StandardFontSize 1 sub scalefont
setfont
/StubSpacing {CheckHeight 6 div} def
CheckHorOffset 2 div StubSpacing 5 mul moveto
CheckNumberString show
0.3 inch StubSpacing 4 mul moveto
(Date ) show
CheckHorOffset 0.3 inch sub StubSpacing 4 mul lineto
0.3 inch StubSpacing 3 mul moveto
(Payee ) show
CheckHorOffset 0.3 inch sub StubSpacing 3 mul lineto
0.3 inch StubSpacing 2 mul moveto
(Amount ) show
CheckHorOffset 0.3 inch sub StubSpacing 2 mul lineto
0.3 inch StubSpacing 1 mul moveto
(Memo ) show
CheckHorOffset 0.3 inch sub StubSpacing 1 mul lineto
stroke
restore
} if
} def
/DrawOriginalCheckBody {
DrawBankInfo
DrawAccountHolderInfo
DrawMemoLine
DrawSignatureLine
DrawAmountLine
DrawPayeeLine
DrawCheckNumber
DrawFraction
DrawDateLine
/DrawLogo where { pop DrawLogo } if
DrawStub
} def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% QStandard & QWallet Feature Printing Routines %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%BeginProcSet: nextline
%%Creator: James Klicman <[email protected]>
%%CreationDate: October 2002
%%Version: 0.3
%
% state used by initline and nextline
%
/LINESTATE <<
/x 0
/y 0
/rx 0
/ry 0
>> def
%
% LineHeight initline -
%
/initline {
LINESTATE begin
currentpoint
/y exch def
/x exch def
/ty exch def
/tx exch def
end
} def
%
% - nextline -
%
/nextline {
LINESTATE begin
x tx add
dup /x exch def % x += tx
y ty add
dup /y exch def % y += ty
moveto % x y moveto
end
} def
%%EndProcSet
%%BeginProcSet: alignment
%%Creator: James Klicman <[email protected]>
%%CreationDate: October 2002
%%Version: 0.3
%
% (string) centeralign (string)
%
/centeralign {
dup % dup (string)
stringwidth % calculate string xWidth, yHeight
pop % discard yHeight
2 div neg % -(xWidth / 2)
0 rmoveto % rmoveto center
} def
%
% (string) rightalign (string)
%
/rightalign {
dup stringwidth % calculate string xWidth, yHeight
pop % discard yHeight
neg 0 rmoveto % -xWidth 0 rmoveto
} def
%
% (string) stringbbox x1 y1 x2 y2
%
% This procedure is based on the method described in Chapter 5 page 333
% of the PostScript Language Reference third edition.
%
/stringbbox {
gsave
newpath 0 0 moveto false charpath flattenpath pathbbox % x1 y1 x2 y2
grestore
} def
%
% (string) topalign (string)
%
/topalign {
dup stringbbox % ^+ x1 y1 x2 y2
neg 0 exch rmoveto % 0 -y2 rmoveto
pop % x2
pop % y1
pop % x1
} def
%
% (string) bottomalign (string)
%
/bottomalign {
dup stringbbox % ^+ x1 y1 x2 y2
pop % y2
pop % x2
neg 0 exch rmoveto % 0 -y1 rmoveto
pop % x1
} def
%%EndProcSet
%%BeginProcSet: qchecks
%%Creator: James Klicman <[email protected]>
%%CreationDate: October 2002
%%Version: 0.3
/QStandardConfig <<
/RightMarginX CheckWidth RightMargin sub
/UnderlineOffset -3
/MemoLineWidth 3.25 inch
/SignatureLineWidth 3.25 inch
/PayToTheOrderOf {
currentpoint % oldpoint
0 StandardFontSize rmoveto % move up one line
(PAY TO THE) show
moveto % oldpoint moveto
(ORDER OF ) show
}
% QStandard Coords, Check Size 8.5" x 3.5"
/Date [ 503.08 183.44]
/Amount [ 499.96 147.44 ]
/Verbal [ 36.04 123.44 ]
/Payee [ 84.04 147.44 ]
/Memo [ 63.16 39.44 ]
/Address [ 72.04 99.44 ]
/Stub false
>> def
/QWalletConfig <<
/RightMarginX CheckWidth RightMargin sub
/UnderlineOffset -2
/MemoLineWidth 2.5 inch
/SignatureLineWidth 2.5 inch
/PayToTheOrderOf {
0 StandardFontSize 2 mul rmoveto % move up two lines
0 StandardFontSize neg initline
(PAY) show nextline
(TO THE) show nextline
(ORDER OF ) show
}
% QWallet Coords, Check Size 6" x 2.8333"
/Date [ 346.12 147.44 ]
/Amount [ 331.96 135.44 ]
/Verbal [ 24.04 123.44 ]
/Payee [ 46.12 135.44 ]
/Address [ 25.0 99.44 ]
/Memo [ 45.16 39.44 ]
/Stub true
/StubDate [ 31.96 147.44 ]
/StubPayee [ 31.96 123.44 ]
/StubAmount [ 52.12 87.44 ]
/StubMemo [ 31.96 63.44 ]
/StubCategory [ 31.96 39.44 ]
/StubAccount [ 31.96 15.44 ]
>> def
%
% /name (label) DrawQLabeline-rightmargin -
%
% draw label and underline to right margin
%
/DrawQLabeline-rightmargin {
% show label
% ^ /name (label)
exch QCONFIG exch get aload pop % ^ (label) X Y
2 copy % ^ (label) X Y X Y
moveto % X Y moveto
3 -1 roll % (label) X Y -> X Y (label)
rightalign show % (label) rightalign show
% ^ X Y
Underline { % if
% underline
% line goes from end of label to right margin
% ^ X Y
exch ( ) stringwidth pop sub exch % backup X one space
QCONFIG /UnderlineOffset get add % adjust underline position
newpath
dup % UnderlineY dup
3 1 roll % X, Y, Y -> Y, X, Y
moveto % X Y moveto
% UnderlineY is on the stack
QCONFIG /RightMarginX get
exch lineto % RightMarginX UnderlineY lineto
stroke
}
% else
{ pop pop }
ifelse
} def
/DrawQDate {
/Date (Date ) DrawQLabeline-rightmargin
} def
/DrawQAmount {
/Amount ($ ) DrawQLabeline-rightmargin
} def
/DrawQPayee {
% label: PAY TO THE ORDER OF
LeftMargin
QCONFIG /Payee get 1 get % PayeeY
moveto % LeftMargin PayeeY moveto
QCONFIG /PayToTheOrderOf get exec
Underline { % if
% underline: Payee
% line goes from end of "ORDER OF" to beginning of "$ amount"
currentpoint
QCONFIG /UnderlineOffset get add % CurrentY + UnderlineOffset
newpath
dup % UnderlineY dup
3 1 roll % X, Y, Y -> Y, X, Y
moveto % X Y moveto
% ^ UnderlineY
QCONFIG /Amount get 0 get % AmountX
( $ ) stringwidth pop % AdjustX
sub % PayeeLineEndX = AmountX - AdjustX
exch lineto % PayeeLineEndX UnderlineY lineto
stroke
} if
} def
/DrawQVerbal {
% label: Dollars
QCONFIG /RightMarginX get
( DOLLARS) stringwidth
pop % discard yHeight
sub % RightMarginX - StringWidthX
% ^ LabelX
QCONFIG /Verbal get 1 get % VerbalY
2 copy % LabelX VerbalY 2 copy
moveto % LabelX VerbalY moveto
( DOLLARS) show
% ^ LabelX VerbalY
Underline { % if
newpath
QCONFIG /UnderlineOffset get add % VerbalY + UnderlineOffset
dup % dup UnderlineY
3 1 roll % X Y Y -> Y X Y
moveto % LabelX UnderlineY moveto
LeftMargin exch lineto % LeftMargin UnderlineY lineto
stroke
}
% else
{ pop pop }
ifelse
} def
/DrawQMemo {
% label: Memo
LeftMargin
QCONFIG /Memo get 1 get % MemoY
moveto % LeftMargin MemoY moveto
(Memo ) show
Underline { % if
% underline: Memo
0 QCONFIG /UnderlineOffset get rmoveto % 0 UnderlineOffset rmoveto
currentpoint
newpath
moveto % currentpoint moveto
QCONFIG /MemoLineWidth get 0 rlineto
stroke
} if
} def
/DrawQSignature {
QCONFIG /RightMarginX get
% if
userdict /SignatureLineHeight known
{
SignatureLineHeight
}
% else
{
QCONFIG /Memo get 1 get % MemoY
QCONFIG /UnderlineOffset get % UnderlineOffset
add % MemoY UnderlineOffset add
} ifelse
% ^ RightMarginX SignatureY
newpath
moveto % RightMarginX UnderlineY moveto
QCONFIG /SignatureLineWidth get neg 0 rlineto
stroke
} def
%
% [(string) ...] boldlines DrawQInfo -
%
% Draw array of strings as separate lines of text centered and topaligned
% to the currentpoint. Null strings are skipped. If the string is non-null
% and it's index is less than boldlines, the bold font is used.
%
/DrawQInfo {
0 % counter
false % istopaligned
% ^ [(string)] boldlines counter istopaligned
4 -1 roll % ^ boldlines counter istopaligned [(string)]
{
% ^ boldlines counter istopaligned (string)
dup length 0 gt { % if
% bold font if one of boldlines
2 index % counter
4 index % boldlines
lt {
currentfont % save font to stack
BoldFontName findfont
StandardFontSize scalefont
setfont
5 1 roll % ^ font boldlines counter istopaligned (string)
} if
exch % ^ (string) istopaligned
% if istopaligned
{
nextline
true % istopaligned
}
% else
{
topalign
0 StandardFontSize neg initline
true % istopaligned
}
ifelse
exch % ^ istopaligned (string)
centeralign show % (string) centeralign show
% ^ boldlines counter istopaligned
% restore font if one of boldlines
1 index % counter
3 index % boldlines
lt {
% ^ font boldlines counter istopaligned
4 -1 roll % ^ boldlines counter istopaligned font
setfont % restore font from stack
} if
}
% else
{ pop } % discard (string)
ifelse
exch 1 add exch % increment counter
} forall
pop % discard istopaligned
pop % discard counter
pop % discard boldlines
} def
/DrawQBankInfo {
QCONFIG /Date get 0 get 4 div 3 mul % DraweeX
CheckHeight TopMargin sub % DraweeY
moveto % DraweeX DraweeY moveto
[ BankName BankAddr1 BankAddr2 BankCityStateZip ] 1 DrawQInfo
} def
/DrawQAccountHolderInfo {
QCONFIG /Date get 0 get 3 div % DraweeX
CheckHeight TopMargin sub % DrawerY
moveto % DrawerX DrawerY moveto
[ Name1 Name2 Address1 Address2 CityStateZip PhoneNumber ] 2 DrawQInfo
} def
/DrawQCheckNumberAndFraction {
currentfont % save font to stack
CheckNumFontName findfont
CheckNumFontSize scalefont
setfont
CheckWidth RightMargin sub % NumberX
CheckHeight TopMargin sub % NumberY
moveto % NumberX NumberY moveto
CheckNumberString topalign
0 StandardFontSize 1.25 mul neg initline
rightalign show
nextline
FractionFontName findfont
FractionFontSize scalefont
setfont
Fraction topalign rightalign show
setfont % restore font from stack
} def
%
% LeftX RightX Y (label) DrawQStubLabeline -
%
/DrawQStubLabeline {
4 -1 roll % ^ RightX Y (label) LeftX
2 index % Y index
moveto % LeftX Y moveto
% ^ RightX Y (label)
show % (label) show
% ^ RightX Y
QCONFIG /UnderlineOffset get % ^ RightX Y UnderlineOffset
dup 0 exch rmoveto % Offset start of line
add % Y UnderlineOffset add
lineto % RightX Y lineto
} def
/DrawQStub {
CheckHorOffset 2 inch ge
QCONFIG /Stub get
and { % if
gsave
CheckHorOffset neg 0 translate
newpath
StandardFontName findfont
StandardFontSize 1 sub scalefont
setfont
0.1875 inch % ^ LeftX
dup CheckHorOffset exch sub % ^ LeftX RightX
2 copy % LeftX RightX
QCONFIG /StubDate get 1 get % DateY
(DATE )
DrawQStubLabeline
2 copy % LeftX RightX
QCONFIG /StubPayee get 1 get % PayeeY
(PAYEE )
DrawQStubLabeline
2 copy % LeftX RightX
QCONFIG /StubAmount get 1 get % AmountY
(AMOUNT )
DrawQStubLabeline
2 copy % LeftX RightX
QCONFIG /StubMemo get 1 get % MemoY
(MEMO )
DrawQStubLabeline
2 copy % LeftX RightX
QCONFIG /StubCategory get 1 get % CategoryY
(CATG. )
DrawQStubLabeline
2 copy % LeftX RightX
QCONFIG /StubAccount get 1 get % AccountY
(ACCT. )
DrawQStubLabeline
Underline { stroke } if
CheckNumFontName findfont
CheckNumFontSize scalefont
setfont
% ^ LeftX RightX
CheckHeight TopMargin sub moveto % RightX TextTop moveto
CheckNumberString topalign rightalign show
pop % LeftX
grestore
} if
} def
/DrawQCheckBody {
DrawQDate
DrawQAmount
DrawQPayee
DrawQVerbal
DrawQMemo
DrawQSignature
DrawQBankInfo
DrawQAccountHolderInfo
DrawQCheckNumberAndFraction
DrawQStub
/DrawLogo where { pop DrawLogo } if
} def
/DrawQStandardCheckBody {
/QCONFIG QStandardConfig def
DrawQCheckBody
} def
/DrawQWalletCheckBody {
/QCONFIG QWalletConfig def
DrawQCheckBody
} def
%%EndProcSet
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Standard Feature Printing Routines %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/DrawMICR {
% 0.25 high, 5.6875 from right edge should be in the middle
% of the tolerance band
CheckWidth 0.25 inch moveto
-5.6875 inch 0 inch rmoveto
MICRHorTweak MICRVerTweak rmoveto
% Now we're at the nominal start of the routing number
MICRFontName findfont
MICRFontSize scalefont
setfont
% Number of digits in the CheckNumberString
/CheckNumDigit CheckNumberString length 1 sub def
CheckNumInAuxOnUs {
CheckNumEnd -1 CheckNumStart {
CheckNumDigit 0 ge {
AuxOnUs exch CheckNumberString CheckNumDigit get put
/CheckNumDigit CheckNumDigit 1 sub def
} {
AuxOnUs exch (0) 0 get put
} ifelse
} for
} if
AuxOnUs stringwidth pop neg 0 rmoveto
AuxOnUs show
Routing show
CheckNumInOnUs {
CheckNumEnd -1 CheckNumStart {
CheckNumDigit 0 ge {
OnUs exch CheckNumberString CheckNumDigit get put
/CheckNumDigit CheckNumDigit 1 sub def
} {
OnUs exch (0) 0 get put
} ifelse
} for
} if
OnUs show
StandardFontName findfont
StandardFontSize scalefont
setfont
} def
/DrawVOID {
save
StandardFontName findfont
50 scalefont
setfont
newpath
CheckWidth 2 div 1 inch moveto
30 rotate
(V O I D) stringwidth pop 0 moveto
(V O I D) true charpath
stroke
restore
} def
/DrawCheck {
% Convert CheckNumber integer to a string
CheckNumber CheckNumberString cvs
pop % discard reference to CheckNumberString
PrintCheckBody {
CheckLayoutDict CheckLayout get exec