pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1602223 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
Date Thu, 12 Jun 2014 16:29:33 GMT
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
             {



Mime
View raw message