support indirect name tokens for cidtogidmap in cid fonts #191

This commit is contained in:
Eliot Jones
2020-07-19 14:36:11 +01:00
parent 98af575ee3
commit 48522ae1a5

View File

@@ -291,12 +291,15 @@
return new CharacterIdentifierToGlyphIndexMap(); return new CharacterIdentifierToGlyphIndexMap();
} }
if (entry is NameToken) if (DirectObjectFinder.TryGet(entry, pdfScanner, out NameToken _))
{ {
return new CharacterIdentifierToGlyphIndexMap(); return new CharacterIdentifierToGlyphIndexMap();
} }
var stream = DirectObjectFinder.Get<StreamToken>(entry, pdfScanner); if (!DirectObjectFinder.TryGet(entry, pdfScanner, out StreamToken stream))
{
throw new PdfDocumentFormatException($"No stream or name token found for /CIDToGIDMap in dictionary: {dictionary}.");
}
var bytes = stream.Decode(filterProvider); var bytes = stream.Decode(filterProvider);