4
votes

how to set page size in the postscript? how to rotate the document to width? . .

%!
%% Example 1

newpath
100 200 moveto
200 250 lineto
100 300 lineto
2 setlinewidth
stroke

showpage

Thank you.

2
What did you try so far?Alexander Vogt
See the example in stackoverflow.com/questions/8072070/…. To 'rotate' -- you cannot actually rotate the page inside the printer, can you? -- you need to rotate your drawing.Jongware
But, why - points? O_o :-(Týna Šindelářová

2 Answers

5
votes

To set the page size to A4 landscape use:

<< /PageSize [842 595] >> setpagedevice

before the first marking operator. Rotation is not needed.
Full PostScript reference is at http://www.adobe.com/products/postscript/pdfs/PLRM.pdf

1
votes

To switch to landscape format:

Move origin from lower left to lower right corner, then rotate the coordinate system 90 degrees.

595 0 translate % 595 is width of A4 paper in points
90 rotate