summaryrefslogtreecommitdiff
path: root/Resource
diff options
context:
space:
mode:
authorKen Sharp <ken.sharp@artifex.com>2021-08-16 17:24:30 +0100
committerKen Sharp <ken.sharp@artifex.com>2021-08-16 17:24:30 +0100
commitddc6a47ac703ded6518b2bc5069023006c1e7c01 (patch)
tree5ee50e58c8cfc13fec271135b749fd1942ed97cd /Resource
parentb37862e5390ac1ab02256088195e10a2b181d12e (diff)
downloadghostpdl-ddc6a47ac703ded6518b2bc5069023006c1e7c01.tar.gz
Fix pdfi+GS with spot capable devices
This is a chain of problems. Firstly we were unconditionally setting the 'init_graphics' parameter to pdfi_check_page() which caused it to close and reopen the device. This throws away the Media Size, CTM and any cropping/rotation etc which we set up in the PostScript world. Resolving that then showed that we were not resetting the number of spots on each page. Resolving that then showed up a failure to determine that a device was spot colour capable, because we were doing the pdfi_check_page() call to retrieve the per-page transparency and spot information when the PDF graphics state wasn't pointing to the PostScript graphics state, which meant we were using the nulldevice. This commit fixes all of the above problems. The various spot-capable devices now render their content to the correct size/orientation/clip and get the correct number of spots.
Diffstat (limited to 'Resource')
-rw-r--r--Resource/Init/pdf_main.ps11
1 files changed, 4 insertions, 7 deletions
diff --git a/Resource/Init/pdf_main.ps b/Resource/Init/pdf_main.ps
index aaf808072..877b0e1f5 100644
--- a/Resource/Init/pdf_main.ps
+++ b/Resource/Init/pdf_main.ps
@@ -341,13 +341,10 @@ systemdict /NEWPDF known not {/NEWPDF //false def} if
/PageUsesTransparency exch % << >> <<page dict>> /PageUsesTransparency bool
3 index 3 1 roll % << >> <<page dict>> <<info dict>> << >> /PageUsesTransparency bool
put % <</PageUsesTransparency bool>> <<page dict>>
- /NumSpots get dup 0 gt {
- /PageSpotColours exch % <</PageUsesTransparency bool>> /PageSpotColours int
- 2 index 3 1 roll % <</PageUsesTransparency bool>> <</PageUsesTransparency bool>> /PageSpotColours int
- put % <</PageUsesTransparency bool /PageSpotColours int>>
- }{
- pop % <</PageUsesTransparency bool>>
- } ifelse
+ /NumSpots get % <</PageUsesTransparency bool>> int
+ /PageSpotColors exch % <</PageUsesTransparency bool>> /PageSpotColors int
+ 2 index 3 1 roll % <</PageUsesTransparency bool>> <<page dict>> /PageSpotColors int
+ put % <</PageUsesTransparency bool /PageSpotColors int >>
setpagedevice
}bind def