diff options
author | Michael Vrhel <michael.vrhel@artifex.com> | 2022-03-02 09:23:18 -0800 |
---|---|---|
committer | Michael Vrhel <michael.vrhel@artifex.com> | 2022-03-02 09:24:28 -0800 |
commit | 418295bc6028635222e1d871b73230c761a87242 (patch) | |
tree | 4a679ae655644ba58886e3cdaa3631fc09ac2d64 /Resource | |
parent | 6702b327c89ba10e1fce475f372c2fbbcd3f3210 (diff) | |
download | ghostpdl-418295bc6028635222e1d871b73230c761a87242.tar.gz |
If simulate overprint, make sure patterns use transparency
Thanks to Ken Sharp for providing the solution for this.
If we are doing pattern simulation with the pdf14 device
then the patterns should also do this. Otherwise we can
get seg faults. For example:
-sDEVICE=bitrgbtags -dNEWPDF=false -dOverprint=/simulate
-r72 -o output.ppm -f tests_private/comparefiles/Bug693541.pdf
Diffstat (limited to 'Resource')
-rw-r--r-- | Resource/Init/pdf_draw.ps | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Resource/Init/pdf_draw.ps b/Resource/Init/pdf_draw.ps index b8d564eac..691a8bd6a 100644 --- a/Resource/Init/pdf_draw.ps +++ b/Resource/Init/pdf_draw.ps @@ -1410,6 +1410,25 @@ currentdict end readonly def ] cvx put dup /BBox 2 copy knownoget { normrect FixPatternBBox put } { pop pop } ifelse dup /.pattern_uses_transparency 1 index patternusestransparency put + + % Regardless of whether we are using transparency, if we are doing Overprint + % simulation we still need to have the pattern code push the pdf14 compositor. + % We consider we are doing overprint simulation if: + % The current page device has /Overprint set to /simulate + % The current page device does NOT contain PageSpotColors (spot-capable devices can overprint) + % The current page device has a /PageUsesOverprint key (set by the interpreter) and it is set to true + % If all these conditions are true then we set /.pattern_uses_transparency, otherwise we leave it + % untouched as set above. + % + currentpagedevice dup + /Overprint get /simulate eq + 1 index /PageSpotColors known not and + exch /PageUsesOverprint .knownget not { //false } if + and + { + dup /.pattern_uses_transparency //true put + } if + PDFDEBUG { //pdfdict /PDFSTEPcount .knownget { 1 le } { //true } ifelse { (%Pattern: ) print dup === flush } if } if } bind executeonly def |