Created attachment 51973 [details] [review] patch against 0.18.0 (after applying the patch for bug 41374) The postscript generated by pdftops gets errors on tiling patterns with PaintType 2. In PaintType 2 patterns, the pattern is uncolored, and you set the color when you use the pattern. The level 1 version created a font and used setcachedevice (which builds a color into the font) instead of setcharwidth. The level 2 version didn't push the current color on the stack which lead to a stack underflow error. When the setpattern operator is called with a pattern with PaintType 2, it looks for the paint color on the stack.
Created attachment 51974 [details] [review] patch against the original 0.18.0 (combines the patch for bug 41374)
Created attachment 51975 [details] pdf that shows the problem
Created attachment 51976 [details] postscript source of the pdf I made the pdf by running this postscript file through gs9.04 ps2pdf. It is based on an example in the postscript language reference manual.
Can this be regtested without applying the patch of 41374 or better wait until we fix that issue?
(In reply to comment #4) > Can this be regtested without applying the patch of 41374 or better wait until > we fix that issue? I suggest getting bug 41374 fixed first. I have found some problems with this patch and am working on a new patch.
Created attachment 52078 [details] [review] 0003-ps-fix-uncolored-tiling-patterns.patch The patch in comment 0 worked with gs but failed when printing. The problem is that color operators must not be used inside uncolored patterns/type3 chars. This patch disables the use of color setting operators when uncolored patterns and type 3 chars are emitted. I've successfully tested this patch with the pdf in comment 2 on three different PostScript printers.
I applied the 0001 and 0002 patches from bug 41374 and the 0003 patch here (retesting after each patch), and the combination appears to work for all of my test files. The pdfSetColor change adds a little bit of overhead for the test before every color operator. Is it necessary or is it just working around a deeper problem that could be solved through a variable in poppler rather than a variable in the generated postscript? William
Created attachment 52104 [details] [review] 0003-ps-fix-uncolored-tiling-patterns.patch I've update patch 0003 to use a flag in PSOutputDev instead of in the PS prolog. Could you test is this prevents the slow down in your tests.
I tested the updated 0003 patch, and it seems to work for all of my test files. Compared to a git snapshot from Aug 12, the level1 output is the same, while the level2 output is better, plus the PaintType 2 test works. I don't have a method accurate enough to time the difference processing the generated postscript of the two versions of 0003.
Patches commited
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.