1 | [PS]
|
2 |
|
3 | @EPS
|
4 | Long = "PostScript (printable)"
|
5 | Width = 7.75
|
6 | Height = 11.00
|
7 |
|
8 | Header2 = "%% the real drawing size:\n"\
|
9 | "\n"\
|
10 | "/MinDrawX %6d EU def\n"\
|
11 | "/MinDrawY %6d EU def\n"\
|
12 | "/MaxDrawX %6d EU def\n"\
|
13 | "/MaxDrawY %6d EU def\n"\
|
14 | "\n"\
|
15 | "%% the usable page size:\n"\
|
16 | "\n"\
|
17 | "/LeftMargin 0.25 inch def %% change these if drawing gets clipped!\n"\
|
18 | "/BotMargin 0.25 inch def\n"\
|
19 | "/PageWidth %7.4f inch def\n"\
|
20 | "/PageHeight %7.4f inch def\n"\
|
21 | "\n"\
|
22 | "%% are we going to rotate?:\n"\
|
23 | "\n"\
|
24 | "/RotateDrawing %d 0 ne def\n"\
|
25 | "\n"
|
26 | ;(x1, y1, x2, y2, Width, Height, DoRotate)
|
27 |
|
28 | Header3 = "%% Media size functions:\n"\
|
29 | "\n"\
|
30 | "/AbortMessage { %% Show a message in a box and stop printing\n"\
|
31 | " /h 100 def\n"\
|
32 | " /Courier findfont 12 scalefont setfont\n"\
|
33 | " mediawidth pagemargin sub h 1 setpage\n"\
|
34 | " newpath\n"\
|
35 | " 0 0 moveto\n"\
|
36 | " 0 h rlineto\n"\
|
37 | " mediawidth pagemargin sub 0 rlineto\n"\
|
38 | " 0 h neg rlineto\n"\
|
39 | " closepath\n"\
|
40 | " 5 setlinewidth\n"\
|
41 | " stroke\n"\
|
42 | " newpath 50 60 moveto (ERROR: Jobsize exceeds physical printing area!) show\n"\
|
43 | " newpath 50 40 moveto ( Job has been aborted!) show\n"\
|
44 | " showpage\n"\
|
45 | " stop\n"\
|
46 | " } def\n"\
|
47 | "\n"\
|
48 | "/SelectPage { %% Select the page identified by Row and Column\n"\
|
49 | " /Column exch def\n"\
|
50 | " /Row exch def\n"\
|
51 | "\n"\
|
52 | " %% the actually exposed area (if the machine knows these parameters!):\n"\
|
53 | "\n"\
|
54 | " /DrawX MaxDrawX MinDrawX sub def\n"\
|
55 | " /DrawY MaxDrawY MinDrawY sub def\n"\
|
56 | " statusdict /setpage known\n"\
|
57 | " statusdict /mediawidth known and\n"\
|
58 | " statusdict /medialength known and\n"\
|
59 | " statusdict /pagemargin known and {\n"\
|
60 | " %% this is for machines that can tell the media size:\n"\
|
61 | " statusdict begin\n"\
|
62 | " /MediaW mediawidth pagemargin sub def\n"\
|
63 | " DrawX DrawY ge {\n"\
|
64 | " DrawX MediaW le DrawY medialength le and {\n"\
|
65 | " MediaW DrawY 1 setpage\n"\
|
66 | " MediaW DrawX sub 2 div 0 translate\n"\
|
67 | " }{\n"\
|
68 | " DrawY MediaW le DrawX medialength le and {\n"\
|
69 | " MediaW DrawX 0 setpage\n"\
|
70 | " 0 MediaW DrawY sub 2 div translate\n"\
|
71 | " }{\n"\
|
72 | " AbortMessage\n"\
|
73 | " } ifelse\n"\
|
74 | " } ifelse\n"\
|
75 | " }{\n"\
|
76 | " DrawY MediaW le DrawX medialength le and {\n"\
|
77 | " MediaW DrawX 0 setpage\n"\
|
78 | " 0 MediaW DrawY sub 2 div translate\n"\
|
79 | " }{\n"\
|
80 | " DrawX MediaW le DrawY medialength le and {\n"\
|
81 | " MediaW DrawY 1 setpage\n"\
|
82 | " MediaW DrawX sub 2 div 0 translate\n"\
|
83 | " }{\n"\
|
84 | " AbortMessage\n"\
|
85 | " } ifelse\n"\
|
86 | " } ifelse\n"\
|
87 | " } ifelse\n"\
|
88 | " end\n"\
|
89 | " }{\n"\
|
90 | " %% this is for machines that can NOT tell the media size:\n"\
|
91 | " %% (Ghostscript doesn't like this!)\n"\
|
92 | " /Product product length string def\n"\
|
93 | " /i 0 def\n"\
|
94 | " product { dup 97 lt { 32 add } if Product exch i exch put /i i 1 add def } forall \n"\
|
95 | " Product (ghostscript) search dup /IsGhostscript exch def\n"\
|
96 | " { pop pop } if\n"\
|
97 | " pop\n"\
|
98 | " IsGhostscript not {\n"\
|
99 | " statusdict /setpage known {\n"\
|
100 | " statusdict begin\n"\
|
101 | " RotateDrawing {\n"\
|
102 | " LeftMargin PageHeight add BotMargin DrawY add\n"\
|
103 | " }{\n"\
|
104 | " BotMargin DrawY add LeftMargin DrawX add \n"\
|
105 | " } ifelse\n"\
|
106 | " 0 setpage\n"\
|
107 | " end\n"\
|
108 | " } if\n"\
|
109 | " } if\n"\
|
110 | " %% set clipping boundary:\n"\
|
111 | " newpath\n"\
|
112 | " LeftMargin BotMargin moveto\n"\
|
113 | " 0 PageHeight rlineto\n"\
|
114 | " PageWidth 0 rlineto\n"\
|
115 | " 0 PageHeight neg rlineto\n"\
|
116 | " closepath\n"\
|
117 | " clip\n"\
|
118 | " %% set the origin:\n"\
|
119 | " LeftMargin BotMargin translate\n"\
|
120 | " RotateDrawing {\n"\
|
121 | " 0 PageHeight translate\n"\
|
122 | " -90 rotate\n"\
|
123 | " PageHeight Column mul neg PageWidth Row mul neg translate\n"\
|
124 | " }{\n"\
|
125 | " PageWidth Column mul neg PageHeight Row mul neg translate\n"\
|
126 | " } ifelse\n"\
|
127 | " } ifelse\n"\
|
128 | " %% move the lower left corner of the drawing to the origin:\n"\
|
129 | " MinDrawX neg MinDrawY neg translate\n"\
|
130 | " \n"\
|
131 | " %% Linestyle:\n"\
|
132 | " \n"\
|
133 | " 1 setlinecap\n"\
|
134 | " 1 setlinejoin\n"\
|
135 | " \n"\
|
136 | " } def\n"\
|
137 | "\n"\
|
138 | "%% TheDrawing\n"
|
139 |
|
140 | StartPage= "\ngsave %d %d SelectPage\n" ;(Row, Column)
|
141 | EndPage = "showpage grestore\n"
|