[cups.bugs] [MOD] STR #3075: pstops filter ignored %%PageBoundingBox if it is inside %%BeginPageSetup and %%EndPageSetup

Till Kamppeter till.kamppeter at gmail.com
Mon Jan 26 09:45:10 PST 2009


DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Ghostscript 8.64 (perhaps older versions, too) produces page headers like
this when converting PDF to PostScript:

%%Page: 2 2
%%BeginPageSetup
%%PageBoundingBox: 0 0 1191 842
GS_pswrite_3_0_1001 begin
1191 842 null setpagesize
/pagesave save store 197 dict begin
0.1 0.1 scale
%%EndPageSetup

Note that the "%%PageBoundingBox" line is in the "%%BeginPageSetup ...
%%EndPageSetup" part.

The pstops CUPS filter does not search the "%%PageBoundingBox" line there
and adds its own "%%PageBoundingBox" line (with the values from the
"PageSize" option) between "%%Page" and "%%BeginPageSetup":

%%Page: 2 2
%%PageBoundingBox: 0 0 595 842
%%BeginPageSetup
%%PageBoundingBox: 0 0 1191 842
GS_pswrite_3_0_1001 begin
1191 842 null setpagesize
/pagesave save store 197 dict begin
0.1 0.1 scale
%%EndPageSetup

It also takes the values of its own "%%PageBoundingBox" line to
calculate the document bounding box in the end of the file, which leads
to the document bounding box also having the values according to the
"PageSize" option and not to the document.

This breaks the printing of documents with multiple page sizes. Trays do
not get automatically changed to print each page on the correct paper size
and so the content of bigger pages gets cut.

As the DSC specs do not forbid page-specific DSC comments being inside the
"%%BeginPageSetup ... %%EndPageSetup" section, pstops should search in one
loop from "%%Page" to after "%%EndPageSetup" (until first non-comment line
after "%%EndPageSetup") for page-specific DSC comments.

See also

http://partners.adobe.com/public/developer/en/ps/5001.DSC_Spec.pdf

Link: http://www.cups.org/str.php?L3075
Version: 1.3.9





More information about the cups mailing list