summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlgs/Resource/Init/pdf_main.ps
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlgs/Resource/Init/pdf_main.ps')
-rw-r--r--Master/tlpkg/tlgs/Resource/Init/pdf_main.ps58
1 files changed, 47 insertions, 11 deletions
diff --git a/Master/tlpkg/tlgs/Resource/Init/pdf_main.ps b/Master/tlpkg/tlgs/Resource/Init/pdf_main.ps
index a16f5806734..1e3fae2e589 100644
--- a/Master/tlpkg/tlgs/Resource/Init/pdf_main.ps
+++ b/Master/tlpkg/tlgs/Resource/Init/pdf_main.ps
@@ -1,4 +1,4 @@
-% Copyright (C) 2001-2012 Artifex Software, Inc.
+% Copyright (C) 2001-2018 Artifex Software, Inc.
% All Rights Reserved.
%
% This software is provided AS-IS with no warranty, either express or
@@ -9,8 +9,8 @@
% of the license contained in the file LICENSE in this distribution.
%
% Refer to licensing information at http://www.artifex.com or contact
-% Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134, San Rafael,
-% CA 94903, U.S.A., +1(415)492-9861, for further information.
+% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
+% CA 94945, U.S.A., +1(415)492-9861, for further information.
%
% pdf_main.ps
@@ -649,7 +649,6 @@ pdfdict begin
PDFfile fileposition
/dictlevelcount 0 def
/TrailerSizeError false def
- /ICCProfileNError false def
/TrailerSize 0 def
{
@@ -1008,14 +1007,47 @@ currentdict /xref-char-dict undef
/Outlines knownoget {
/NO_PDFMARK_OUTLINES where {pop NO_PDFMARK_OUTLINES not}{true}ifelse
{
- /First knownoget {
+ dup /First known {
+ 100 dict exch %% dictionary for detecting circular references
+ /First get dup type /packedarraytype eq { %% << >> {} or << >>
+ dup 0 get dup %% << >> {} object_num object_num
+ 3 index 3 1 roll %% << >> {} << >> object_num object_num
+ put
+ oforce
+ } if
+
dup type /dicttype eq {
- { dup writeoutline /Next knownoget not { exit } if
- dup type /dicttype eq not {exit} if
+ {
+ dup
+ /Next known {
+ dup /Next get %% << >> <</Next...>> {} or << >>
+ dup type /packedarraytype eq {
+ dup 0 get %% << >> <</Next....>> {} object_num
+ dup 4 index exch known {
+ (\n **** ERROR: Circular reference detected in Outlines,\n) pdfformaterror
+ ( terminating Outline processing.\n) pdfformaterror
+ ( Output may be incorrect.\n) pdfformaterror
+ %% << >> <</Next....>> {} object_num
+ pop pop dup /Next undef %% << >> <<.....>>
+ writeoutline exit
+ } if
+ %% << >> <</Next....>> {} object_num
+ dup 3 index 3 1 roll put %% << >> <</Next....>> {}
+ oforce
+ } if
+ exch writeoutline %% << >> </Next object>
+ dup type /dicttype eq not
+ {pop exit} if
+ } {
+ writeoutline exit
+ }ifelse
} loop
+ pop
}
- {pop} ifelse
- }if
+ {pop pop} ifelse
+ }{
+ pop
+ }ifelse
} {
pop
}ifelse
@@ -1275,6 +1307,7 @@ currentdict /xref-char-dict undef
/RepairedAnError //false def
/StreamRunAborted //false def
/NeedAppearances //false def
+ /ICCProfileNError false def
currentglobal //true .setglobal globaldict begin
/UndefProcList 0 dict def
end .setglobal
@@ -2661,7 +2694,7 @@ currentdict /PDF2PS_matrix_key undef
/showpagecontents { % <pagedict> showpagecontents -
dup % Save the pagedict for the Annotations
count 1 sub /pdfemptycount exch store
- gsave % preserve gstate for Annotations later
+ /pdfemptycount where pop /annot_gstate gstate currentgstate put % preserve gstate for Annots later
/Contents knownoget not { 0 array } if
dup type /arraytype ne { 1 array astore } if {
oforce dup type /dicttype eq {
@@ -2681,7 +2714,7 @@ currentdict /PDF2PS_matrix_key undef
} {
pop
} ifelse
- grestore
+ annot_gstate setgstate % restore the gstate for Annots
% Draw the annotations
//systemdict /ShowAnnots .knownget not { //true } if {
/Annots knownoget {
@@ -2881,6 +2914,9 @@ currentdict /PDF2PS_matrix_key undef
4 dict exch resourceusestransparency { pop pop //true exit } if
} if
} if % If AP dict known
+ dup /BM knownoget {
+ //true exit
+ } if
dup /CA knownoget {
1 le {
pop pop //true exit