mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-04-05 20:55:01 +08:00
map missing character codes directly #44
previously if no matching unicode was found for a character code we would return a null letter. instead we now map from the character code directly to a character. this seems to work for most documents, except where there are ligatures, e.g. fi or ff, but is still better than not returning anything.
This commit is contained in:
parent
198cca1336
commit
557d8bc948
@ -24,7 +24,7 @@
|
||||
|
||||
var page2 = document.GetPage(2);
|
||||
|
||||
Assert.Contains("isθc={θc1,θc2,...,θcn},", page2.Text);
|
||||
Assert.Contains("is~θc={θc1,θc2,...,θcn},", page2.Text);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -137,6 +137,8 @@
|
||||
if (!foundUnicode || unicode == null)
|
||||
{
|
||||
log.Warn($"We could not find the corresponding character with code {code} in font {font.Name}.");
|
||||
// Try casting directly to string as in PDFBox 1.8.
|
||||
unicode = new string((char)code, 1);
|
||||
}
|
||||
|
||||
var wordSpacing = 0m;
|
||||
|
Loading…
Reference in New Issue
Block a user