PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

errors when modifying certain pdfs
https://forum.pdfsharp.net/viewtopic.php?f=2&t=3467
Page 1 of 1

Author:  chrisc [ Thu Sep 29, 2016 12:50 am ]
Post subject:  errors when modifying certain pdfs

Hi,

I have a file upload form that users use to upload pdfs.
Pdf sharp date stamps the pdfs that are uploaded.
It seems to work for most pdfs but it seems that a few users receive an error.
In the logs I get the following:

System.NullReferenceException: Object reference not set to an instance of an object. at PdfSharp.Pdf.PdfPages.GetKids(PdfReference iref, InheritedValues values, PdfDictionary parent...

I am using PDFsharp-1_50-beta3b.
Any suggestions on what may be causing this error?

Kind regards,
Chris

Author:  Thomas Hoevel [ Thu Sep 29, 2016 8:11 am ]
Post subject:  Re: errors when modifying certain pdfs

Hi!
chrisc wrote:
Any suggestions on what may be causing this error?
Sounds like a known issue that was not resolved yet.
I don't know whether or not the files are valid, but we shall try to support them with PDFsharp.

Author:  pisiakamuskin [ Thu Dec 08, 2016 11:15 am ]
Post subject:  Re: errors when modifying certain pdfs

Hi, i have the same issue with some pdf files,
Could i email you a pdf to check what is the problem.

Thanks in advance.

Author:  Thomas Hoevel [ Thu Dec 08, 2016 1:52 pm ]
Post subject:  Re: errors when modifying certain pdfs

Hi!
I sent you a PM with our e-mail address for file submissions.

Author:  kmcinnomate [ Mon Mar 12, 2018 1:49 pm ]
Post subject:  Re: errors when modifying certain pdfs

Is there any news on this issue? I'm experiencing the same exception, but since the files are confidential, I can't share them, unfortunately.

Thanks in advance.

My stack trace is:
Code:
at PdfSharp.Pdf.PdfPages.GetKids(PdfReference iref, InheritedValues values, PdfDictionary parent)
at PdfSharp.Pdf.PdfPages.FlattenPageTree()
at PdfSharp.Pdf.Advanced.PdfCatalog.get_Pages()
at PdfSharp.Pdf.PdfDocument.get_Pages()
...


I've tried PDFsharp.1.50.4000-beta3b and PDFsharp-MigraDoc.1.50.4790-beta5a with same result.

EDIT: I have attached some output from veraPDF (it's probably not supposed to be a PDF/A file, but it still might give you some hints). Sorry for hijacking the thread if it's a different issue.

Attachments:
htmlReport.zip [11.76 KiB]
Downloaded 308 times

Author:  Thomas Hoevel [ Tue Mar 13, 2018 9:42 am ]
Post subject:  Re: errors when modifying certain pdfs

PDFsharp 1.50 was not optimized for the handling of corrupt PDF files.

There are some pull requests on GitHub that improve dealing with corrupt PDF files. Maybe one of them helps with the Kid problem.
The pull requests will be included in future versions of PDFsharp.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/