[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1717-g34774ab

[email protected] (Ken Sharp) Wed, 9 Oct 2019 15:45:38 +0000 (UTC)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, master has been updated
       via  34774ab185f17186b26949f5fee118dee9114d3a (commit)
      from  b2c1beac237865bde26c7fa921d24d17ecda6fab (commit)

----------------------------------------------------------------------
commit 34774ab185f17186b26949f5fee118dee9114d3a
Author: Ken Sharp <[email protected]>
Date:   Wed Oct 9 16:45:31 2019 +0100

    PDF interpreter - fix /None case of Line Ending style
    
    Bug #701622 "pdfwrite device fails with annotation appearance"
    
    This is, in fact, nothing at all to do with pdfwrite. The problem is
    that, when generating an Appearance stream for a /Line Annotation which
    is defined without an Appearance stream, the /None line ending style
    was not popping the copy of the annotation dictionary.
    
    This led to an error in the annotation. If a previous annotation used
    transparency, then this would cause the compositor to get confused,
    because we would start the transparency in the Line annotation, but
    the error meant we would not close the transparency group.

diff --git a/Resource/Init/pdf_draw.ps b/Resource/Init/pdf_draw.ps
index c0805da..e8caaef 100644
--- a/Resource/Init/pdf_draw.ps
+++ b/Resource/Init/pdf_draw.ps
@@ -3795,7 +3795,7 @@ currentdict /set_bc_color undef
       fillborderpath
       grestore
     } bind executeonly def
-    /None {} bind executeonly def
+    /None {pop} bind executeonly def
     /Butt {
       dup
       /BS knownoget {
@@ -3881,15 +3881,23 @@ currentdict /set_bc_color undef
       gsave
       //startannottransparency exec
       dup /L knownoget {
-        1 index /LE knownoget {
+        1 index /LE knownoget { % <annot> [x1 y1 x2 y2] [LE1 LE2]
           gsave
-          1 index aload pop  % x1 y1 x2 y2
-          3 -1 roll sub      % x1 x2 dy
-          3 1 roll exch sub  % dy dx
+          1 index aload pop     % <annot> [x1 y1 x2 y2] [LE1 LE2] x1 y1 x2 y2
+          3 -1 roll sub         % <annot> [x1 y1 x2 y2] [LE1 LE2] x1 x2 dy
+          3 1 roll exch sub     % <annot> [x1 y1 x2 y2] [LE1 LE2] dy dx
           2 copy translate
-          atan
+          atan                  % <annot> [x1 y1 x2 y2] [LE1 LE2]
           rotate
-          dup 0 get dup //LineEnd_dict exch known not {pop /None} if //LineEnd_dict exch get 3 index exch exec
+          dup 0 get             % <annot> [x1 y1 x2 y2] [LE1 LE2] LE1
+          dup //LineEnd_dict exch known not
+          {
+            pop /None
+          } if
+          //LineEnd_dict exch   % <annot> [x1 y1 x2 y2] [LE1 LE2] <dict> LE1
+          get                   % <annot> [x1 y1 x2 y2] [LE1 LE2] {}
+          3 index exch          % <annot> [x1 y1 x2 y2] [LE1 LE2] <annot> {}
+          exec
           grestore
           gsave
           1 index aload pop  % x1 y1 x2 y2


Summary of changes:
 Resource/Init/pdf_draw.ps | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)