Search code examples
pdfpostscript

create two pdfs from one .ps file?


I need to reformat a text file into a PDF. Using Perl, I am modifying an existing PostScript template file based on what is in the text file. Sometimes this text file will be long enough to require a two page PDF.

Can I create a two page PDF file from one .ps file using GhostScript? If so, what tells GhostScript where the page break should occur?

Maybe I need to use two template files. One for a one page pdf and another for a two page PDF.


Solution

  • PostScript doesn't directly have the concept of text flows or page breaks. The showpage operator renders the page to the device, clears the page and starts a new one. PS to PDF conversion will create a new page in the PDF on this operator. If you want to chop up a PostScript file into pages, psutils is a series of programs for manipulating PostScript files.