Bug 690948

Summary: BoundingBox/MediaSize info initialized too late in pxlcolor
Product: Ghostscript Reporter: Hin-Tak Leung <htl10>
Component: VectorsAssignee: Hin-Tak Leung <htl10>
Status: CONFIRMED ---    
Severity: normal CC: christinedelight.top85, sphinx.pinastri
Priority: P4 Keywords: bountiable
Version: master   
Hardware: PC   
OS: Linux   
Customer: Word Size: ---
Attachments: Sample file

Description Hin-Tak Leung 2009-11-22 18:59:17 UTC
Bug690683.ps from tests_private/comparefiles has an unusual issue when processed
by the pxlcolor driver - the boundingbox info is only available after a few
drawing instructions (I think one of them is a design issue of gdevvec where a
clip path is issued on open). This causes a problem with PXL since the page
dimension are attributes of BeginPage and cannot be easily changed after drawing
starts, when compared with other devices.

I tried delaying the BeginPage until the first NewPath. (width/height are letter
size values on entry, and reaches the final values only a few drawing
instructions in).

A workaround is to run -sDEVICE=bbox first and then set the dimension with -g
explicitly; otherwise the file is wrongly processed as letter size.
Comment 1 Hin-Tak Leung 2009-11-22 19:08:02 UTC
While looking at this, I wonder why the DSC info is not used for setting the
device width/height at all. The PS file concerned have DSC PageBoundingBox, and
also does a (clip?) path early on in postscript code.
Comment 2 Ray Johnston 2009-12-03 09:54:44 UTC
There is a 'fillpage' procedure that may be a better place to issue the
'BeginPage'.
Comment 3 Hin-Tak Leung 2009-12-03 10:24:59 UTC
Thanks for the tips - I'll give it a try.
Comment 4 Peter Cherepanov 2021-02-14 07:52:59 UTC
Created attachment 20614 [details]
Sample file

This problem still occurs in the current version.
gs -sDEVICE=pxlcolor -o a.pxl a.ps
generates empty Letter-sized file instead of 1000x1000 point page with a black square.