mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-07-15 09:55:15 +08:00
#444 handle invalid tounicode map objects in tt fonts
This commit is contained in:
parent
03692cf42f
commit
4e490d63be
@ -106,6 +106,8 @@
|
||||
|
||||
CMap toUnicodeCMap = null;
|
||||
if (dictionary.TryGet(NameToken.ToUnicode, out var toUnicodeObj))
|
||||
{
|
||||
try
|
||||
{
|
||||
var toUnicode = DirectObjectFinder.Get<StreamToken>(toUnicodeObj, pdfScanner);
|
||||
|
||||
@ -116,6 +118,11 @@
|
||||
toUnicodeCMap = CMapCache.Parse(new ByteArrayInputBytes(decodedUnicodeCMap));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("Failed to decode ToUnicode CMap for a TrueType font in file due to an exception.", ex);
|
||||
}
|
||||
}
|
||||
|
||||
Encoding encoding = encodingReader.Read(dictionary, descriptor);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user