Adobe Distiller: erasepage erroneously transmits a page
The operator ‘showpage’ should push a piece of paper through the printer; ‘erasepage’ should not. Analogously, erasepage should not add a page to a PDF.
In XI Pro 11.0.21 (26/07/2017), the following code makes a two-page file, the second page being blank. It should be a one-pager. This bug has cost me hours of attempting to debug my PostScript.
%!PS
/Helvetica-Bold 36 selectfont
36 36 moveto (First page) show
showpage
36 36 moveto (Second page) show
erasepage
-
Julian D. A. Wiseman commented
I understand the automatic showpage if marks have been painted, for the EPS reason you give. But erasepage ought to ‘unmark’ the page, such that it becomes clean and does not then cause an automatic showpage (unless more marks are subsequently painted).
-
Dov Isaacs commented
Confirming that this also occurs with Acrobat DC Distiller.
I then performed a second test in which I removed the erasepage command and tried distilling that. Ironically but consistently, I also got a second page out, this time with the text on the bottom of the second page. In a third test, I removed the second show command but left the erasepage. In this case, the second page was not generated.
Apparently, the Distiller outputs a “page” at the end of job if any marking operation has been performed since the last showpage. Thus, it isn't the erasepage that is causing the page to be output (in this case to PDF), but rather the previous marking of the page at all via the second show command.
Fortunately, OS PostScript drivers and PostScript-generating applications generally do not mark the page after the last showpage.
I suspect that this observed behaviour is in support of distilling EPS files into PDF. EPS files typically don't have a concluding showpage.
- Dov
-
Julian D. A. Wiseman commented