At https://launchpad.net/distros/ubuntu/+source/gs-gpl/+bug/33255 an ubuntu user reports that a particular eps, when converted to pdf with gs pdfwrite, erroneously leaves a particular rectangle transparent rather than filling it with white. The cause is the definition of is_in_page and the code which uses it. is_in_page is tested by gdev_pdf_fill_rectangle and prepare_fill_with_clip, with the intent of suppressing the initial fill of the entire page with white. However, this approach is incorrect, because it suppresses _any number_ of initial white fills. In particular, if the first drawing operation on a page is a white fill, it is suppressed. This is the case in the test file attached to the Ubuntu bug report, above. I'm not sure how best to fix this because I'm not sufficiently familiar with the innards of gs, so I don't know what the right approach is and I'm afraid I haven't supplied a patch. Thanks.
Created attachment 2413 [details] Handover.ps A local copy of the test file.
Created attachment 2414 [details] bad_patch.txt A patch which implements exactly what suggested. It appears not good because enlarges the re-distilled 0.pdf .
Patch to HEAD : http://ghostscript.com/pipermail/gs-cvs/2006-August/006746.html