[prog] Combining PostScript documents

Almut Behrens almut-behrens at gmx.net
Fri May 9 10:13:02 EST 2003


On Fri, May 09, 2003 at 09:08:09AM +0200, Dan Richter wrote:
> Hi everyone.
> 
> I have a bunch of PostScript files (generated by a web browser: print to 
> file). I'd like to combine them into one big PostScript document, one web 
> page per page of PostScript. I'm looking for a quick-and-dirty solution.

usually, it's sufficient to just concatenate the pages, making sure that
each individual page has a "showpage" at the end. However, the question
cannot be answered in general, as it's always theoretically possible to
create postscript code where simply concatenating pages wouldn't work...
There are a couple of things you could try in this case, so just report
back if you don't get it working...

> 
> 1) Each file starts and ends with meta-directives, each beginning with two 
> percent signs (%%). Does anyone know how these are really used? What 
> happens if I get rid of them?

those are so-called DSC comments (Document Structuring Conventions),
containing meta information about the document (e.g. the bounding box
coordinates). "%" in general comments out the respective line of
postscript code, so - for the postscript interpreter - those "%%" are
just comments, too. They are used by some postscript processing tools
to rearrange pages, insert encapsulated postscript fragments (EPS)
appropriately into other documents, etc. The postscript interpreter
itself ignores them. If you don't need/want them, you can remove them,
though I wouldn't know why you would want to do that...

> 
> 2) What is the PostScript instruction to start a new page?

showpage -- well, more precisely, this command renders the the
internally built-up page contents onto the output medium.


Almut



More information about the Programming mailing list