mirror of
https://github.com/UglyToad/PdfPig.git
synced 2026-03-10 00:23:29 +08:00
Use pdfScanner in ReadVerticalDisplacements and fix #693 and return 0 in CMap on exception in ReadByte() if useLenientParsing is true and fix #692
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -4,6 +4,36 @@
|
||||
|
||||
public class GithubIssuesTests
|
||||
{
|
||||
[Fact]
|
||||
public void Issue693()
|
||||
{
|
||||
var doc = IntegrationHelpers.GetDocumentPath("reference-2-numeric-error.pdf");
|
||||
|
||||
using (var document = PdfDocument.Open(doc, new ParsingOptions() { UseLenientParsing = true, SkipMissingFonts = true }))
|
||||
{
|
||||
var page1 = document.GetPage(1);
|
||||
Assert.Equal(1269, page1.Letters.Count);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Issue692()
|
||||
{
|
||||
var doc = IntegrationHelpers.GetDocumentPath("cmap-parsing-exception.pdf");
|
||||
|
||||
using (var document = PdfDocument.Open(doc, new ParsingOptions() { UseLenientParsing = true, SkipMissingFonts = true }))
|
||||
{
|
||||
var page1 = document.GetPage(1);
|
||||
Assert.Equal(796, page1.Letters.Count);
|
||||
}
|
||||
|
||||
using (var document = PdfDocument.Open(doc, new ParsingOptions() { UseLenientParsing = false, SkipMissingFonts = false }))
|
||||
{
|
||||
var ex = Assert.Throws<InvalidOperationException>(() => document.GetPage(1));
|
||||
Assert.StartsWith("Read byte called on input bytes which was at end of byte set.", ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Issue874()
|
||||
{
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
[
|
||||
"issue_671.pdf",
|
||||
"GHOSTSCRIPT-698363-0.pdf",
|
||||
"ErcotFacts.pdf"
|
||||
"ErcotFacts.pdf",
|
||||
"cmap-parsing-exception.pdf"
|
||||
];
|
||||
|
||||
[Theory]
|
||||
|
||||
Reference in New Issue
Block a user