pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1722668 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java
Date Sat, 02 Jan 2016 21:37:50 GMT
Author: tilman
Date: Sat Jan  2 21:37:50 2016
New Revision: 1722668

URL: http://svn.apache.org/viewvc?rev=1722668&view=rev
Log:
PDFBOX-3123: "undocumented case of using Identity-H/V as a ToUnicode CMap" only if it is a
COSName, not if it is a stream

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java?rev=1722668&r1=1722667&r2=1722668&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java Sat Jan 
2 21:37:50 2016
@@ -401,11 +401,13 @@ public abstract class PDFont implements
         // if the font dictionary containsName a ToUnicode CMap, use that CMap
         if (toUnicodeCMap != null)
         {
-            if (toUnicodeCMap.getName() != null && toUnicodeCMap.getName().startsWith("Identity-"))
+            if (toUnicodeCMap.getName() != null && toUnicodeCMap.getName().startsWith("Identity-")
&& 
+                    dict.getDictionaryObject(COSName.TO_UNICODE) instanceof COSName)
             {
                 // handle the undocumented case of using Identity-H/V as a ToUnicode CMap,
this
-                // isn't  actually valid as the Identity-x CMaps are code->CID maps, not
+                // isn't actually valid as the Identity-x CMaps are code->CID maps, not
                 // code->Unicode maps. See sample_fonts_solidconvertor.pdf for an example.
+                // PDFBOX-3123: do this only if the /ToUnicode entry is a name
                 return new String(new char[] { (char) code });
             }
             else



Mime
View raw message