[cups.bugs] [MOD] STR #2004: orientation and mirroring shouldn't use save/restore around showpage

David Gelphman gelphman at apple.com
Tue Oct 3 14:12:19 PDT 2006


[STR New]

I got a bug report from a printer vendor who is complaining that the pstops
filter is wrapping pages in save/restore when only doing orientation
changes. Sure enough, I see that is happening in the current code. The
problem for this developer is that they rely on the correct behavior for
showpage, i.e. that showpage is not executed inside of a save/restore.

e.g. it should be this:

save

restore
showpage

not this:

save

showpage
restore

The incorrect execution prevents redefinition of the showpage operator and
obtaining correct semantics.

Since the showpage operator does an implicit initgraphics, there should be
no need for the save/restore you are doing in this situation. Now there is
a separate issue for n-up but in that case you do the right thing, i.e.
the equivalent of:

%%Page: 1 1
save
% first virtual page drawing
restore
save
% second virtual page drawing
restore
....
% done with all virtual pages for this sheet
executerealshowpage
%%Page: 2 2

Therefore, I propose the following code change to address this bug:

--- pstops.c    (revision 219)
+++ pstops.c    (working copy)
@@ -660,7 +660,7 @@
   }

@@ -1868,7 +1868,7 @@
 end_nup(pstops_doc_t *doc,             /* I - Document information */
         int          number)           /* I - Page number */
 {
-  if (doc->mirror || Orientation || doc->number_up > 1)
+  if (doc->number_up > 1)
     doc_puts(doc, "userdict/ESPsave get restore\n");

   switch (doc->number_up)
@@ -2543,7 +2543,7 @@
                bboxl;                  /* BoundingBox height */


-  if (doc->mirror || Orientation || doc->number_up > 1)
+  if (doc->number_up > 1)
     doc_puts(doc, "userdict/ESPsave save put\n");

   if (doc->mirror)

Link: http://www.cups.org/str.php?L2004
Version: 1.2-current





More information about the cups-devel mailing list