5 out("%%%%Page: %d %d\n", n
, n
);
6 out("/saveobj save def\n");
8 out("%d pagesetup\n", n
);
11 void ps_pageend(int n
)
15 out("saveobj restore\n");
16 out("%%%%EndPage: %d %d\n", n
, n
);
19 void ps_trailer(int pages
, char *fonts
)
23 out("%%%%DocumentFonts: %s\n", fonts
);
24 out("%%%%Pages: %d\n", pages
);
29 "/pagesize [612 792] def\n"
32 " counttomark 2 idiv {def} repeat pop\n"
33 " /scaling 72 resolution div def\n"
34 " linewidth setlinewidth\n"
36 " 0 pagesize 1 get translate\n"
37 " scaling scaling scale\n"
43 " currentdict /pagedict known currentdict page known and {\n"
44 " page load pagedict exch get cvx exec\n"
48 "/w {neg moveto show} bind def\n"
49 "/m {neg moveto} bind def\n"
50 "/g {neg moveto {glyphshow} forall} bind def\n"
51 "/rgb {255 div 3 1 roll 255 div 3 1 roll 255 div 3 1 roll setrgbcolor} bind def\n"
52 "/done {/lastpage where {pop lastpage} if} def\n"
54 "% caching fonts, as selectfont is supposed to be doing\n"
55 "/fncache 7 array def\n"
57 "/selectfont_cached {\n"
63 " ent null eq not {\n"
64 " ent 0 get fname eq {\n"
65 " /font ent 1 get def\n"
70 " /font fname findfont def\n"
71 " fncache fncidx [fname font] put\n"
72 " /fncidx fncidx 1 add def\n"
73 " fncidx fncache length ge {\n"
77 " font fsize scalefont setfont\n"
80 " /font exch def /ptsize exch def\n"
81 " ptsize scaling div /size exch def\n"
82 " font size selectfont_cached\n"
83 " linewidth ptsize mul scaling 10 mul div setlinewidth\n"
86 "/savedmatrix matrix def\n"
91 " savedmatrix currentmatrix pop scale\n"
92 " .5 0 rmoveto currentpoint .5 0 rmoveto .5 0 360 arc\n"
93 " savedmatrix setmatrix\n"
100 " currentpoint dy1 neg add exch dx1 add exch\n"
101 " dx1 dx1 mul dy1 dy1 mul add sqrt\n"
102 " dy1 dx1 neg atan\n"
103 " dy2 neg dx2 atan\n"
113 " x0 5 x1 mul add 6 div\n"
114 " y0 5 y1 mul add -6 div\n"
115 " x2 5 x1 mul add 6 div\n"
116 " y2 5 y1 mul add -6 div\n"
118 " y1 y2 add -2 div\n"
124 out("%%!PS-Adobe-2.0\n");
125 out("%%%%Version: 1.0\n");
126 out("%%%%Creator: neatroff - http://litcave.rudi.ir/\n");
127 out("%%%%DocumentFonts: (atend)\n");
128 out("%%%%Pages: (atend)\n");
129 out("%%%%EndComments\n");
131 out("%%%%BeginProlog\n");
132 out("/resolution %d def\n", dev_res
);
134 out("%%%%EndProlog\n");
135 out("%%%%BeginSetup\n");
136 out("<< /PageSize pagesize /ImagingBBox null >> setpagedevice\n");
139 out("%%%%EndSetup\n");