-
Notifications
You must be signed in to change notification settings - Fork 241
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
"Object reference not set to an instance of an object." #874
Comments
Hi @rklec it's going to be complicated to help you without the document... Can you try with the latest version of PdfPig (pre-release 1.9.0, available via Nuget packages)? |
I'm running into this issue as well with the attached document. If I set SkipMissingFonts to true, the above exceptions gets thrown. When that option is not specified, I get the following exception instead:
Any help with a fix for this would be greatly appreciated! |
The linked |
Hi @rklec should have clarified, but the exception I'm seeing occurs when calling the For example: using PdfDocument? document = PdfDocument.Open( stream );
if ( document is null )
{
_logger.LogWarning( "Failed to open PDF document" );
return result;
}
foreach ( var pg in document.GetPages() )
{
_logger.LogInformation( "Processing page {PageNumber}", pg.Number );
} |
…dGraphicsState(), add and test and fix UglyToad#874
…dGraphicsState(), add and test and fix UglyToad#874
thanks for sharing the document, I've created a PR that fixes the issue when |
…dGraphicsState(), add and test and fix UglyToad#874
Much appreciated @BobLd |
STR
PdfDocument.Open(pdfBytes)
with the some PDF file. As it contains sensitive data, i unfortunately cannot attach it here and I was unfortunately unable to create a minimal example, but some hints:Much like this and I tried to reproduce it with this example, but it does not work:
Thus, i only attach this image, because with the PDF I've created it is not reproducible.
What happens
Apparently, this is the line of failure:
PdfPig/src/UglyToad.PdfPig/PdfExtensions.cs
Line 24 in a99c0d2
What should happen
At least
PdfDocumentFormatException
if you consider the file invalid.However, IMHO, the file is valid an can be opened with both Adobe Acrobat Reader and Firefox. Thus, actually parsing it would be good.
Also, when opening it with Adobe Acrobat Reader and re-saving it, it can be parsed!
System
PDFPig 0.1.8
reproducible on Windows 10
Interne Referenz: 2118
The text was updated successfully, but these errors were encountered: