You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ja...@apache.org on 2014/10/31 06:59:30 UTC

svn commit: r1635678 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java

Author: jahewson
Date: Fri Oct 31 05:59:30 2014
New Revision: 1635678

URL: http://svn.apache.org/r1635678
Log:
PDFBOX-2423: Handle nested Type 3 text operations

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java?rev=1635678&r1=1635677&r2=1635678&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java Fri Oct 31 05:59:30 2014
@@ -264,8 +264,18 @@ public class PDFStreamEngine
 
         // note: we don't clip to the BBox as it is often wrong, see PDFBOX-1917
 
+        // save text matrices (Type 3 stream may contain BT/ET, see PDFBOX-2137)
+        Matrix textMatrixOld = textMatrix;
+        textMatrix = new Matrix();
+        Matrix textLineMatrixOld = textLineMatrix;
+        textLineMatrix = new Matrix();
+
         processStreamOperators(charProc);
 
+        // restore text matrices
+        textMatrix = textMatrixOld;
+        textLineMatrix = textLineMatrixOld;
+
         restoreGraphicsState();
         popResources(parent);
     }