04 January 2010

Don't forget to show the page

If you ever find yourself writing Postscript documents by hand, or creating an application that writes them, don't forget to use the showpage operator. You typically want to call it at the end of each page in your document since it tells the Postscript interpreter to grab all the things you've drawn up to that point and actually render them into a page.

Yes, I know it sounds obvious - who would forget to do that, right? All I can say is it happened to me recently. Both GSview and an office laser printer I was using to test the document displayed it fine without including the operator. I guess they figured, "Well, you've drawn a bunch of things on the page, and I've reached the end of the document, surely you want me to print something so I'll go ahead even though you didn't tell me to do that".

My problem was that the production press the document was intended for didn't use the same common sense approach. It RIP'ed the document without errors and then just sat there (with a smug look on its face, I'm sure). It makes sense, once you realize what's going on, but it took quite a while to figure it out. Anyway, remember to add showpage and everything will be fine.

No comments: