Funky Stuff

There are often times when you will want to take an existing PostScript document and manipulate it in some way. For example, you may be publishing a book, and you want to print the pages with wide margins for proofing notes (but you don’t want to modify the book’s layout). Maybe you are printing out some 100-page manual, and you want to avoid using most of a rain forest to print it. Maybe you want to print out some document with the word “Draft” stamped beneath the pages. All of these things can be done in PostScript by a post-processor (that is, a program which manipulates an existing PostScript file). Moreover, these are all things which may be difficult to manage in the program you used to generate the files.

In this section, I’ll show you the basic PostScript code to do each of these jobs and how to use EPS comments to find the right places to insert the additional PostScript.

You are welcome to use these programs as you will. Bear in mind, however, that there are professionally written programs that do these jobs and more. I strongly suggest that you look into buying such a program rather than writing your own. Generally, they have already solved most of the problems. Also, these packages usually come with tools you did not even know were possible. These examples, therefore, are more to give you a taste of what is possible and how to do it, in case you want to roll your own post-processing utility.

By the way, being an American who rarely gets out of the country (or, indeed, off the sofa), I should warn you that both the “Galley Proofs” and “Two Up” examples are set up for the U.S. Letter paper size (8.5 inches by 11 inches), since this is the kind of paper I have and which my printer uses. They can be adapted for other paper sizes, of course, just the particular scale factors and translation coordinates will have to be adjusted appropriately.