summaryrefslogtreecommitdiff
path: root/Resource
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2022-09-28 15:53:46 +0100
committerChris Liddell <chris.liddell@artifex.com>2022-09-29 08:40:55 +0100
commit9c28e6fa152dc347731d610091aed305faa41973 (patch)
tree8cc692cd7141e4c4ce436ab8c58853a4daa32fac /Resource
parent1c17d0a0881d287ed4f5978ec14d3acf9c847ef9 (diff)
downloadghostpdl-9c28e6fa152dc347731d610091aed305faa41973.tar.gz
Handle CumulativePageCount not being defined
In order to preserve a consistent page count when using multiple input PDFs the PS code defines and maintains CumulativePageCount value. This is initially setup in newpdf_runpdfbegin. But to gain finer grained control over the interpreter, it's necessary to skip using newpdf_runpdfbegin, meaning newpdf_gather_parameters will throw an undefined error on CumulativePageCount. So tweak newpdf_gather_parameters so spot when it isn't defined, and set it to one.
Diffstat (limited to 'Resource')
-rw-r--r--Resource/Init/pdf_main.ps2
1 files changed, 1 insertions, 1 deletions
diff --git a/Resource/Init/pdf_main.ps b/Resource/Init/pdf_main.ps
index a20c95f54..e40883c39 100644
--- a/Resource/Init/pdf_main.ps
+++ b/Resource/Init/pdf_main.ps
@@ -817,7 +817,7 @@ systemdict /NEWPDF known not {/NEWPDF //true def} if
% This isn't a command line parameter, we track it internally, but we need to
% send it to the interpreter. It is used to 'offset' the page Dest for Link
% annotations and Outlines by the numebr of pages processed so far.
- /PageCount CumulativePageCount def
+ /PageCount /CumulativePageCount where { /CumulativePageCount get }{currentpagedevice /PageCount get} ifelse def
currentdict end
} bind executeonly def