Skip to content

Commit 599ce04

Browse files
committed
Add test that fails before revert of e11dc6b
1 parent 2a6ee91 commit 599ce04

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

src/UglyToad.PdfPig.Tests/Integration/GithubIssuesTests.cs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,43 @@
44
using DocumentLayoutAnalysis.PageSegmenter;
55
using DocumentLayoutAnalysis.WordExtractor;
66
using PdfPig.Core;
7+
using PdfPig.Tokens;
78
using SkiaSharp;
89

910
public class GithubIssuesTests
1011
{
12+
[Fact]
13+
public void Revert_e11dc6b()
14+
{
15+
var path = IntegrationHelpers.GetDocumentPath("GHOSTSCRIPT-699488-0.pdf");
16+
17+
using (var document = PdfDocument.Open(path, new ParsingOptions() { UseLenientParsing = true }))
18+
{
19+
var page = document.GetPage(1);
20+
var images = page.GetImages().ToArray();
21+
22+
Assert.Equal(9, images.Length);
23+
24+
foreach (var image in images)
25+
{
26+
if (image.ImageDictionary.TryGet(NameToken.Filter, out var token) && token is NameToken nt)
27+
{
28+
if (nt.Data.Contains("DCT"))
29+
{
30+
continue;
31+
}
32+
}
33+
34+
Assert.True(image.TryGetPng(out _));
35+
}
36+
37+
var paths = page.Paths;
38+
Assert.Equal(66, paths.Count);
39+
var letters = page.Letters;
40+
Assert.Equal(2685, letters.Count);
41+
}
42+
}
43+
1144
[Fact]
1245
public void Issue1199()
1346
{

0 commit comments

Comments
 (0)