Bug 690347

Summary: pswrite device generates %%%%BeginPageSetup
Product: Ghostscript Reporter: norbert.janssen
Component: PS WriterAssignee: Ken Sharp <ken.sharp>
Status: NOTIFIED FIXED    
Severity: normal    
Priority: P4    
Version: 8.64   
Hardware: PC   
OS: Windows 2000   
Customer: 661 Word Size: ---

Description norbert.janssen 2009-03-20 00:50:36 UTC
probably introduced with 9396. The pswrite now generates the BeginPageSetup with
4 '%' characters i.s.o. the required 2. This is incorrect, and causes problems
when using DSC comments to insert tray/simplex/duplex/finishing commands.

gdevpsu.c: at line 287
in revision 9374,
     pprintld2(s, "%%%%Page: %ld %ld\n%%%%BeginPageSetup\n", page, page_ord);
     if (!pdpc->ProduceEPS)
         pprintld2(s, "%%%%PageBoundingBox: 0 0 %ld %ld\n", width, height);
 	  	 
     /*
      * Adobe's documentation says that page setup must be placed outside the
      * save/restore that encapsulates the page contents, and that the

revision 9396, 
     pprintld2(s, "%%%%Page: %ld %ld\n", page, page_ord);
     if (!pdpc->ProduceEPS)
         pprintld2(s, "%%%%PageBoundingBox: 0 0 %ld %ld\n", width, height);
  	     stream_puts(s, "%%%%BeginPageSetup\n");
     /*
      * Adobe's documentation says that page setup must be placed outside the
      * save/restore that encapsulates the page contents, and that the



probably (i did not investigate this) the stream_puts() does not the same as
pprintld2().
Comment 1 norbert.janssen 2009-03-20 00:54:18 UTC
FIX:
replace   	     stream_puts(s, "%%%%BeginPageSetup\n");
with  	             stream_puts(s, "%%BeginPageSetup\n");

at line 291 in gdevpsu.c


Comment 2 Ken Sharp 2009-03-20 01:31:28 UTC
Fixed in revision 9577, patch:

http://ghostscript.com/pipermail/gs-cvs/2009-March/009151.html

Thanks for finding and resolving the problem!