diff options
Diffstat (limited to 'Master/tlpkg/tlgs/Resource/Init/pdf_draw.ps')
-rw-r--r-- | Master/tlpkg/tlgs/Resource/Init/pdf_draw.ps | 120 |
1 files changed, 35 insertions, 85 deletions
diff --git a/Master/tlpkg/tlgs/Resource/Init/pdf_draw.ps b/Master/tlpkg/tlgs/Resource/Init/pdf_draw.ps index 8527312c10c..a93a526ca85 100644 --- a/Master/tlpkg/tlgs/Resource/Init/pdf_draw.ps +++ b/Master/tlpkg/tlgs/Resource/Init/pdf_draw.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2021 Artifex Software, Inc. +% Copyright (C) 2001-2020 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or @@ -762,24 +762,6 @@ def .pdfruncontext end grestore - - % check for extra garbage on the operand stack and clean it up - count pdfemptycount sub dup 0 ne { - ( **** Error: Transparency Group, Form XObject execution corrupted the stack.\n) pdfformaterror - ( Output may be incorrect.\n) pdfformaterror - PDFSTOPONERROR { - /.execgroup cvx /rangecheck signalerror - } { - dup 0 gt { - { pop } repeat - }{ - pop - } ifelse - } ifelse - } { - pop - } ifelse - /pdfemptycount exch store } bind executeonly def @@ -814,22 +796,12 @@ def %% as arguments to .execgroup mark currentcolor counttomark array astore exch pop currentcolorspace 5 2 roll - dup /Group oget dup type /dicttype eq { - exch /BBox oget dup type /arraytype eq { + + dup /Group oget exch /BBox oget % Stack: resdict stream groupdict bbox - .beginformgroup - .execgroup - .endtransparencygroup - }{ - ( **** Error: Form XObject has a BBox entry with an invalid type.\n) pdfformaterror - ( Ignoring transparency Group, output may be incorrect.\n) pdfformaterror - pop pop pop pop pop pop - } ifelse - } { - ( **** Error: Form XObject has a Group entry with an invalid type.\n) pdfformaterror - ( Ignoring transparency Group, output may be incorrect.\n) pdfformaterror - pop pop pop pop pop pop - } ifelse + .beginformgroup + .execgroup + .endtransparencygroup } bind executeonly def % Make an ImageType 103 (soft-masked) image. @@ -2197,15 +2169,7 @@ currentdict /last-ditch-bpc-csp undef ( Output may be incorrect.\n) pdfformaterror } ifelse } if - 1 index /Mask knownoget { - dup type dup /dicttype eq exch /arraytype eq or { % Bug #703681 - 1 index exch /Mask exch put - } { - pop - ( **** Error: Ignoring Mask attribute that is not an array or a dictionary.\n) - pdfformaterror - } ifelse - } if + 1 index /Mask knownoget { 1 index exch /Mask exch put } if makeimagedict doimagesmask } bind executeonly def /makemaskimage { % <datasource> <imagemask> <Mask> makemaskimage @@ -2323,14 +2287,6 @@ currentdict /last-ditch-bpc-csp undef currentdict /SMask knownoget { % We are doing transparency and SMask is present in the image % stack: <imagemask> <SMask> - % Normalize /Matte attribute for .begintransparencymaskimage - dup /Matte .knownget { - oforce dup //null eq { - pop dup /Matte undef - } { - 1 index /Matte [ 4 -1 roll { oforce } forall ] put - } ifelse - } if .begintransparencymaskimage PDFfile fileposition exch gsave //nodict begin @@ -2352,12 +2308,6 @@ currentdict /last-ditch-bpc-csp undef % code only picks up the current colour space, not the space from the dictionary. currentdict /SMask get /Matte known {/CS currentdict /ColorSpace get dup pdfopdict /cs get exec } if >> 0 0 1 1 - gsave 1 1 moveto 0 0 lineto - % If we get an error, just emit an empty box - { pathbbox } stopped { 0 0 0 0 } if - 4 array astore grestore - /image - setup_trans .begintransparencygroup .currentstrokeconstantalpha .currentfillconstantalpha 3 -1 roll 1 .setfillconstantalpha 1 .setstrokeconstantalpha @@ -2459,6 +2409,12 @@ currentdict /last-ditch-bpc-csp undef makemaskimage } if % Stack: datasource imagemask + gsave 1 1 moveto 0 0 lineto + % If we get an error, just emit an empty box + { pathbbox } stopped { 0 0 0 0 } if + 4 array astore grestore + /image + setup_trans { currentdict end setsmaskstate //true ValidateDecode { imagemask } } { ColorSpace setgcolorspace currentdict end setsmaskstate //false ValidateDecode { image } } ifelse @@ -3052,12 +3008,6 @@ drawopdict begin /File PDFsource def currentdict makeimagekeys OFFlevels length 0 eq { - gsave 1 1 moveto 0 0 lineto - % If we get an error, just emit an empty box - { pathbbox } stopped { 0 0 0 0 } if - 4 array astore grestore - /image - setup_trans doimage } { pop Width @@ -4302,7 +4252,7 @@ currentdict /set_bc_color undef dup annotsetcolor { dup drawborder dup calc_annot_scale 2 copy mul 0 ne - {3 -1 roll drawwidget} + {3 -1 roll drawwidget //false} { pop pop ( **** Error: ignoring annotation with scale factor of 0\n) pdfformaterror @@ -4310,7 +4260,6 @@ currentdict /set_bc_color undef }ifelse } if //endannottransparency exec - //false } bind executeonly def /Ink { % <annot> -> <annot> <true> @@ -5410,9 +5359,14 @@ currentdict /drawannottypes undef /Ink {mark exch loadannot /ANN pdfmark //false} bind executeonly def -/PolyLine {mark exch loadannot /ANN pdfmark //false} bind executeonly def - -/Line {mark exch loadannot /ANN pdfmark //false} bind executeonly def +/Line { + mark exch dup /L .knownget { + aload 5 1 roll transform 4 -2 roll transform 4 2 roll + 5 -1 roll astore + 1 index /L 3 -1 roll put + } if + loadannot /ANN pdfmark //false +} bind executeonly def /Link { /NO_PDFMARK_DESTS where {pop NO_PDFMARK_DESTS not}{//true}ifelse @@ -5502,8 +5456,7 @@ currentdict /drawannottypes undef //false } bind executeonly def -%% We don't handle movies correctly, so don't try to preserve them -%/Movie {mark exch loadannot /ANN pdfmark //false} bind executeonly def +/Movie {mark exch loadannot /ANN pdfmark //false} bind executeonly def /Popup {mark exch loadannot /ANN pdfmark //false} bind executeonly def /Sound {mark exch loadannot /ANN pdfmark //false} bind executeonly def /Square {mark exch loadannot /ANN pdfmark //false} bind executeonly def @@ -5764,25 +5717,22 @@ currentdict end def % The recursive enumeration of the form fields doesn't descend into widget annotations. /draw_form_field { % <field> draw_form_field - - dup type /dicttyype eq { % File for Bug692447 has 'null' Fields entries - % This matches what pdf_main process_trailer_attrs - dup /Kids knownoget { % field [] - dup length 0 gt { - dup 0 oget /Parent knownoget { % field [] kid - pop % mon-terminal field % field [] - exch pop % [] - { oforce draw_form_field } forall - } { - pop draw_terminal_field % separate annots % - - } ifelse + dup /Kids knownoget { % field [] + dup length 0 gt { + dup 0 oget /Parent knownoget { % field [] kid + pop % mon-terminal field % field [] + exch pop % [] + { oforce draw_form_field } forall } { - ( **** Error: Ignoring empty /Kids array in Form field.\n) pdfformaterror - ( Output may be incorrect.\n) pdfformaterror + pop draw_terminal_field % separate annots % - } ifelse } { - draw_terminal_field % merged annotation % - + ( **** Error: Ignoring empty /Kids array in Form field.\n) pdfformaterror + ( Output may be incorrect.\n) pdfformaterror } ifelse - } if + } { + draw_terminal_field % merged annotation % - + } ifelse } bind executeonly def /draw_acro_form { % <form> draw_acro_form - |