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 "/resolution 720 def\n"
30 "/pagesize [612 792] def\n"
31 "/inch {72 mul} bind def\n"
34 " counttomark 2 idiv {def} repeat pop\n"
35 " /scaling 72 resolution div def\n"
36 " linewidth setlinewidth\n"
38 " 0 pagesize 1 get translate\n"
39 " scaling scaling scale\n"
45 " currentdict /pagedict known currentdict page known and {\n"
46 " page load pagedict exch get cvx exec\n"
50 "/w {neg moveto show} bind def\n"
51 "/m {neg moveto} bind def\n"
52 "/g {neg moveto {glyphshow} forall} bind def\n"
53 "/rgb {255 div 3 1 roll 255 div 3 1 roll 255 div 3 1 roll setrgbcolor} bind def\n"
54 "/done {/lastpage where {pop lastpage} if} def\n"
56 "% caching fonts, as selectfont is supposed to be doing\n"
57 "/fncache 7 array def\n"
59 "/selectfont_cached {\n"
65 " ent null eq not {\n"
66 " ent 0 get fname eq {\n"
67 " /font ent 1 get def\n"
72 " /font fname findfont def\n"
73 " fncache fncidx [fname font] put\n"
74 " /fncidx fncidx 1 add def\n"
75 " fncidx fncache length ge {\n"
79 " font fsize scalefont setfont\n"
82 " /font exch def /ptsize exch def\n"
83 " ptsize scaling div /size exch def\n"
84 " font size selectfont_cached\n"
85 " linewidth ptsize mul scaling 10 mul div setlinewidth\n"
88 "/savedmatrix matrix def\n"
93 " savedmatrix currentmatrix pop scale\n"
94 " .5 0 rmoveto currentpoint .5 0 rmoveto .5 0 360 arc\n"
95 " savedmatrix setmatrix\n"
102 " currentpoint dy1 neg add exch dx1 add exch\n"
103 " dx1 dx1 mul dy1 dy1 mul add sqrt\n"
104 " dy1 dx1 neg atan\n"
105 " dy2 neg dx2 atan\n"
115 " x0 5 x1 mul add 6 div\n"
116 " y0 5 y1 mul add -6 div\n"
117 " x2 5 x1 mul add 6 div\n"
118 " y2 5 y1 mul add -6 div\n"
120 " y1 y2 add -2 div\n"
126 out("%%!PS-Adobe-2.0\n");
127 out("%%%%Version: 1.0\n");
128 out("%%%%Creator: neatroff - http://litcave.rudi.ir/\n");
129 out("%%%%DocumentFonts: (atend)\n");
130 out("%%%%Pages: (atend)\n");
131 out("%%%%EndComments\n");
133 out("%%%%BeginProlog\n");
135 out("%%%%EndProlog\n");
136 out("%%%%BeginSetup\n");
137 out("<< /PageSize pagesize /ImagingBBox null >> setpagedevice\n");
140 out("%%%%EndSetup\n");