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/28 23:48:35 UTC

svn commit: r1635001 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFTextStreamEngine.java

Author: jahewson
Date: Tue Oct 28 22:48:34 2014
New Revision: 1635001

URL: http://svn.apache.org/r1635001
Log:
PDFBOX-2423: Fix TestTextStripper

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFTextStreamEngine.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFTextStreamEngine.java?rev=1635001&r1=1635000&r2=1635001&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFTextStreamEngine.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFTextStreamEngine.java Tue Oct 28 22:48:34 2014
@@ -68,6 +68,7 @@ public class PDFTextStreamEngine extends
     private int pageRotation;
     private PDRectangle pageSize;
     private GlyphList glyphList;
+    private Matrix legacyCTM;
 
     /**
      * Constructor.
@@ -117,6 +118,13 @@ public class PDFTextStreamEngine extends
         super.processPage(page);
     }
 
+    @Override
+    protected void showText(byte[] string) throws IOException
+    {
+        legacyCTM = getGraphicsState().getCurrentTransformationMatrix().clone();
+        super.showText(string);
+    }
+
     /**
      * This method was originally written by Ben Litchfield for PDFStreamEngine.
      */
@@ -129,7 +137,7 @@ public class PDFTextStreamEngine extends
         //
 
         PDGraphicsState state = getGraphicsState();
-        Matrix ctm = state.getCurrentTransformationMatrix();
+        Matrix ctm = legacyCTM;
         float fontSize = state.getTextState().getFontSize();
         float horizontalScaling = state.getTextState().getHorizontalScaling() / 100f;
         Matrix textMatrix = getTextMatrix();