Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InvalidOperationException calling GetPage() "Failed to parse the content for the page: 32" #953

Open
mikethea1 opened this issue Dec 10, 2024 · 0 comments

Comments

@mikethea1
Copy link

Reproduction:

using var doc = UglyToad.PdfPig.PdfDocument.Open(path);
doc.GetPages().ToArray();

File:
FailedToParseContentForPage32.pdf

Error:

System.InvalidOperationException: Failed to parse the content for the page: 32
   at UglyToad.PdfPig.Content.BasePageFactory`1.Create(Int32 number, DictionaryToken dictionary, PageTreeMembers pageTreeMembers, NamedDestinations namedDestinations) in C:\git\csharp\PdfPig\src\UglyToad.PdfPig\Content\BasePageFactory.cs:line 155
   at UglyToad.PdfPig.Content.Pages.GetPage[TPage](IPageFactory`1 pageFactory, Int32 pageNumber, NamedDestinations namedDestinations, ParsingOptions parsingOptions) in C:\git\csharp\PdfPig\src\UglyToad.PdfPig\Content\Pages.cs:line 100
   at UglyToad.PdfPig.Content.Pages.GetPage(Int32 pageNumber, NamedDestinations namedDestinations, ParsingOptions parsingOptions) in C:\git\csharp\PdfPig\src\UglyToad.PdfPig\Content\Pages.cs:line 43
   at UglyToad.PdfPig.PdfDocument.GetPage(Int32 pageNumber) in C:\git\csharp\PdfPig\src\UglyToad.PdfPig\PdfDocument.cs:line 163
   at UglyToad.PdfPig.PdfDocument.GetPages()+MoveNext() in C:\git\csharp\PdfPig\src\UglyToad.PdfPig\PdfDocument.cs:line 213
   at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
   at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)

This file opens fine in Chrome; page 32 displays as blank. The file is likely corrupt in some way, but it would be nice if PdfPig did not choke on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant