-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle null token in DirectObjectFinder, handle null state in SetName…
…dGraphicsState(), add and test and fix #874
- Loading branch information
Showing
5 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
26 changes: 26 additions & 0 deletions
26
src/UglyToad.PdfPig.Tests/Integration/GithubIssuesTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
namespace UglyToad.PdfPig.Tests.Integration | ||
{ | ||
public class GithubIssuesTests | ||
{ | ||
[Fact] | ||
public void Issue874() | ||
{ | ||
var doc = IntegrationHelpers.GetDocumentPath("ErcotFacts.pdf"); | ||
|
||
using (var document = PdfDocument.Open(doc, new ParsingOptions() { UseLenientParsing = true, SkipMissingFonts = true })) | ||
{ | ||
var page1 = document.GetPage(1); | ||
Assert.Equal(1788, page1.Letters.Count); | ||
|
||
var page2 = document.GetPage(2); | ||
Assert.Equal(2430, page2.Letters.Count); | ||
} | ||
|
||
using (var document = PdfDocument.Open(doc, new ParsingOptions() { UseLenientParsing = true, SkipMissingFonts = false })) | ||
{ | ||
var ex = Assert.Throws<ArgumentNullException>(() => document.GetPage(1)); | ||
Assert.StartsWith("Value cannot be null.", ex.Message); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters