Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In postscript, how do I print onto multiple pages. How do I do this?

Tags:

postscript

I've thoroughly searched the web for answers to this question; however, most of the answers say something about using showpage. I know that you can use showpage to print multiple pages to the printer but I want to view multiple pages on my computer. I would like to see all of the pages in a program like Evince.

I've heard something about using standard comments to print multiple pages but I don't know how they work.

Any helpful comments will be appreciated. Thanks!

like image 352
Derek Avatar asked Dec 13 '22 17:12

Derek


1 Answers

OK, I was having the same issue. Eventually figured it out. This is not perfect but closer than it was...

%!PS-Adobe-2.0

%%Pages: 2
%%Page: 1 1
newpath
100 100 moveto
400 400 lineto
closepath 
5 setlinewidth
stroke
showpage
%%Page: 2 2
newpath
100 400 moveto
400 100 lineto
closepath
10 setlinewidth
stroke
showpage

Without the -Adobe-2.0 and the %%Pages: and %%Page: all viewers were only showing the last page. i.e. showpage was "printing" and discarding the first page. This is now displaying both pages correctly in Document Viewer (Ubuntu) and GhostView (Windows). Adobe Illustrator (windows) is now just showing the first page - so obviously this is not a perfect solution, but a step on the way.

NOTE: The blank line after the header appears to be required. Not sure what's going on here, I've never read any formal postscript documentation.

like image 151
Sodved Avatar answered Dec 28 '22 08:12

Sodved