pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jahew...@apache.org
Subject svn commit: r1634653 - /pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/font/descriptor/FontDescriptorHelper.java
Date Mon, 27 Oct 2014 19:21:38 GMT
Author: jahewson
Date: Mon Oct 27 19:21:37 2014
New Revision: 1634653

URL: http://svn.apache.org/r1634653
Log:
PDFBOX-2405: Preflight - Don't check standard 14 fonts for missing fields

Modified:
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/font/descriptor/FontDescriptorHelper.java

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/font/descriptor/FontDescriptorHelper.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/font/descriptor/FontDescriptorHelper.java?rev=1634653&r1=1634652&r2=1634653&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/font/descriptor/FontDescriptorHelper.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/font/descriptor/FontDescriptorHelper.java
Mon Oct 27 19:21:37 2014
@@ -49,6 +49,7 @@ import org.apache.pdfbox.cos.COSDictiona
 import org.apache.pdfbox.cos.COSName;
 import org.apache.pdfbox.pdmodel.common.PDMetadata;
 import org.apache.pdfbox.pdmodel.common.PDStream;
+import org.apache.pdfbox.pdmodel.font.PDFont;
 import org.apache.pdfbox.pdmodel.font.PDFontDescriptor;
 import org.apache.pdfbox.pdmodel.font.PDFontLike;
 import org.apache.pdfbox.preflight.PreflightContext;
@@ -81,12 +82,18 @@ public abstract class FontDescriptorHelp
     public void validate()
     {
         PDFontDescriptor fd = this.font.getFontDescriptor();
+        boolean isStandard14 = false;
+        if (this.font instanceof PDFont)
+        {
+            isStandard14 = ((PDFont)font).isStandard14();
+        }
+
         // Only a PDFontDescriptorDictionary provides a way to embedded the font program.
         if (fd != null)
         {
             fontDescriptor = fd;
 
-            if (checkMandatoryFields(fontDescriptor.getCOSObject()))
+            if (isStandard14 || checkMandatoryFields(fontDescriptor.getCOSObject()))
             {
                 if (hasOnlyOneFontFile(fontDescriptor))
                 {



Mime
View raw message