Skip to content

Commit 9306176

Browse files
committed
PDFBOX-6022: don't use identity if there's a predefined cmap
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1927183 13f79535-47bb-0310-9956-ffa450edef68
1 parent 5da1086 commit 9306176

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType0Font.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,9 +541,11 @@ public String toUnicode(int code)
541541
{
542542
return unicode;
543543
}
544+
544545
// Use identity mapping if the given ToUnicode CMap doesn't provide any valid mapping
545546
// a predefined map shall only be used if there isn't any ToUnicode CMap
546-
if (getToUnicodeCMap() != null)
547+
// PDFBOX-6022: not when there's a predefined cmap
548+
if (getToUnicodeCMap() != null && !isCMapPredefined)
547549
{
548550
return Character.toString((char) code);
549551
}

0 commit comments

Comments
 (0)