pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1857789 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
Date Fri, 19 Apr 2019 08:51:32 GMT
Author: tilman
Date: Fri Apr 19 08:51:32 2019
New Revision: 1857789

URL: http://svn.apache.org/viewvc?rev=1857789&view=rev
Log:
PDFBOX-4520: don't render type3 fonts when text rendering mode is 3 (invisible)

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=1857789&r1=1857788&r2=1857789&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 Fri Apr
19 08:51:32 2019
@@ -64,6 +64,7 @@ import org.apache.pdfbox.pdmodel.common.
 import org.apache.pdfbox.pdmodel.common.function.PDFunction;
 import org.apache.pdfbox.pdmodel.documentinterchange.markedcontent.PDPropertyList;
 import org.apache.pdfbox.pdmodel.font.PDFont;
+import org.apache.pdfbox.pdmodel.font.PDType3Font;
 import org.apache.pdfbox.pdmodel.font.PDVectorFont;
 import org.apache.pdfbox.pdmodel.graphics.PDLineDashPattern;
 import org.apache.pdfbox.pdmodel.graphics.PDXObject;
@@ -431,7 +432,7 @@ public class PageDrawer extends PDFGraph
             cache = new GlyphCache(vectorFont);
             glyphCaches.put(font, cache);
         }
-        
+
         GeneralPath path = cache.getPathForCharacterCode(code);
         drawGlyph(path, font, code, displacement, at);
     }
@@ -450,7 +451,7 @@ public class PageDrawer extends PDFGraph
     {
         PDGraphicsState state = getGraphicsState();
         RenderingMode renderingMode = state.getTextState().getRenderingMode();
-        
+
         if (path != null)
         {
             // Stretch non-embedded glyph if it does not match the height/width contained
in the PDF.
@@ -499,7 +500,19 @@ public class PageDrawer extends PDFGraph
             }
         }
     }
-    
+
+    @Override
+    protected void showType3Glyph(Matrix textRenderingMatrix, PDType3Font font, int code,
+            String unicode, Vector displacement) throws IOException
+    {
+        PDGraphicsState state = getGraphicsState();
+        RenderingMode renderingMode = state.getTextState().getRenderingMode();
+        if (!RenderingMode.NEITHER.equals(renderingMode))
+        {
+            super.showType3Glyph(textRenderingMatrix, font, code, unicode, displacement);
+        }
+    }
+
     @Override
     public void appendRectangle(Point2D p0, Point2D p1, Point2D p2, Point2D p3)
     {



Mime
View raw message