mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-07-16 23:43:45 +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;
|
CMap toUnicodeCMap = null;
|
||||||
if (dictionary.TryGet(NameToken.ToUnicode, out var toUnicodeObj))
|
if (dictionary.TryGet(NameToken.ToUnicode, out var toUnicodeObj))
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
var toUnicode = DirectObjectFinder.Get<StreamToken>(toUnicodeObj, pdfScanner);
|
var toUnicode = DirectObjectFinder.Get<StreamToken>(toUnicodeObj, pdfScanner);
|
||||||
|
|
||||||
@ -116,6 +118,11 @@
|
|||||||
toUnicodeCMap = CMapCache.Parse(new ByteArrayInputBytes(decodedUnicodeCMap));
|
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);
|
Encoding encoding = encodingReader.Read(dictionary, descriptor);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user