| 1 |
%! |
| 2 |
/HPSdict 20 dict dup begin/braindeaddistill 50 def/rfch{dup length 1 sub |
| 3 |
1 exch getinterval}bind def/splituri{dup(#)search{exch pop}{()exch} |
| 4 |
ifelse dup(file:)anchorsearch{pop exch pop 3 -1 roll pop false}{pop 3 -1 |
| 5 |
roll exch pop true}ifelse}bind def/lookuptarget{exch rfch dup |
| 6 |
/TargetAnchors where{pop TargetAnchors dup 3 -1 roll known{exch get true |
| 7 |
}{pop(target unknown:)print == false}ifelse}{pop pop |
| 8 |
(target dictionary unknown\012)print false}ifelse}bind def/savecount 0 |
| 9 |
def/stackstopped{count counttomark sub/savecount exch store stopped |
| 10 |
count savecount sub 1 sub dup 0 gt{{exch pop}repeat}{pop}ifelse}bind def |
| 11 |
/tempstring 128 string def/targetvalidate{1 index dup length 127 gt exch |
| 12 |
tempstring cvs dup(/)search{pop pop pop exch pop true exch}{pop}ifelse |
| 13 |
token{pop length 0 ne}{true}ifelse or not}bind def/targetdump-hook where |
| 14 |
{pop}{/targetdump-hook{dup mark exch gsave initmat setmatrix{{mark/Dest |
| 15 |
4 2 roll targetvalidate{aload pop exch pop/Page 3 1 roll/View exch[exch |
| 16 |
/FitH exch]/DEST pdfmark}{cleartomark}ifelse}forall}stackstopped pop |
| 17 |
grestore}bind def}ifelse/baseurl{mark exch 1 dict dup 3 -1 roll/Base |
| 18 |
exch put/URI exch/DOCVIEW{pdfmark}stackstopped pop}bind def |
| 19 |
/externalhack systemdict/PDF known def/oldstyle true def/initmat matrix |
| 20 |
currentmatrix def/actiondict 2 dict dup/Subtype/URI put def |
| 21 |
/weblinkhandler{dup 3 1 roll mark 4 1 roll/Title 4 1 roll splituri 3 -1 |
| 22 |
roll dup length 0 gt{cvn/Dest exch 4 2 roll}{pop}ifelse{externalhack{ |
| 23 |
/HTTPFile exch}{actiondict dup 3 -1 roll/URI exch put/Action exch} |
| 24 |
ifelse}{externalhack{/HTTPFile exch}{/File exch/Action/GoToR}ifelse} |
| 25 |
ifelse counttomark 2 sub -1 roll aload pop/Rect 4 1 roll/Border 3 1 roll |
| 26 |
/Color exch oldstyle{/LNK}{/Subtype/Link/ANN}ifelse gsave initmat |
| 27 |
setmatrix{pdfmark}stackstopped grestore}bind def/externalhandler where{ |
| 28 |
pop}{/externalhandler{2 copy{weblinkhandler}exec{/externalhack |
| 29 |
externalhack not store 2 copy{weblinkhandler}exec{/externalhack |
| 30 |
externalhack not store/oldstyle false store 2 copy{weblinkhandler}exec{ |
| 31 |
(WARNING: external refs disabled\012)print/externalhandler{pop pop}bind |
| 32 |
store externalhandler}{pop pop}ifelse}{pop pop/externalhack externalhack |
| 33 |
not store}ifelse}{pop pop/externalhandler{weblinkhandler pop}bind store} |
| 34 |
ifelse}bind def}ifelse/pdfmnew{dup type/stringtype eq{externalhandler}{ |
| 35 |
exch dup rfch exch 3 -1 roll lookuptarget{mark 4 1 roll/Title 4 1 roll |
| 36 |
aload pop exch pop/Page 3 1 roll/View exch[exch/FitH exch]5 -1 roll |
| 37 |
aload pop/Rect 4 1 roll/Border 3 1 roll/Color exch/LNK gsave initmat |
| 38 |
setmatrix pdfmark grestore}{pop pop}ifelse}ifelse}bind def/pdfmold{dup |
| 39 |
type/stringtype eq{externalhandler}{exch dup rfch exch 3 -1 roll |
| 40 |
lookuptarget{mark 4 1 roll/Title 4 1 roll aload pop exch pop/Page 3 1 |
| 41 |
roll/View exch[exch/FitH exch]5 -1 roll aload pop pop 0 3 getinterval |
| 42 |
/Rect 3 1 roll/Border exch/LNK gsave initmat setmatrix pdfmark grestore} |
| 43 |
{pop pop}ifelse}ifelse}bind def/pdfm where{pop}{/pdfm |
| 44 |
/currentdistillerparams where{pop currentdistillerparams dup |
| 45 |
/CoreDistVersion known{/CoreDistVersion get}{0}ifelse dup |
| 46 |
braindeaddistill le{(WARNING: switching to old pdfm because version =) |
| 47 |
print ==/pdfmold}{pop/pdfmnew}ifelse load}{/pdfmark where{pop{dup type |
| 48 |
/stringtype eq{externalhandler}{2 copy mark 3 1 roll{pdfmnew} |
| 49 |
stackstopped{2 copy mark 3 1 roll{pdfmold}stackstopped{ |
| 50 |
(WARNING: pdfm disabled\012)print/pdfm{pop pop}store}{ |
| 51 |
(WARNING: new pdfm failed, switching to old pdfm\012)print/pdfm/pdfmold |
| 52 |
load store}ifelse}{/pdfm/pdfmnew load store}ifelse pop pop}ifelse}}{{ |
| 53 |
pop pop}}ifelse}ifelse bind def}ifelse end def |