You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by le...@apache.org on 2014/06/12 18:29:33 UTC

svn commit: r1602223 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java

Author: lehmi
Date: Thu Jun 12 16:29:33 2014
New Revision: 1602223

URL: http://svn.apache.org/r1602223
Log:
PDFBOX-2137: save/restore the current Text- and TextLineMatrix when rendering a type3 font stream as proposed by Petr Slaby

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java?rev=1602223&r1=1602222&r2=1602223&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java Thu Jun 12 16:29:33 2014
@@ -396,16 +396,21 @@ public class PageDrawer extends PDFStrea
             COSStream stream = font.getCharStream((char)codePoints[i]);
             if (stream != null)
             {
-                // save the current graphics state
+                // save the current graphics state and matrices
                 getGraphicsStack().push((PDGraphicsState) getGraphicsState().clone());
-
+                Matrix textMatrix = getTextMatrix();
+                Matrix textLineMatrix = getTextLineMatrix();
+                
                 Matrix ctm = new Matrix();
                 ctm.setFromAffineTransform(at);
                 getGraphicsState().setCurrentTransformationMatrix(ctm);
                 processSubStream(font.getType3Resources(), stream);
 
-                // restore the saved graphics state
+                // restore the saved graphics state and matrices
                 setGraphicsState(getGraphicsStack().pop());
+                setTextLineMatrix(textLineMatrix);
+                setTextMatrix(textMatrix);
+                 
             }
             else
             {