You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it should be null or have some meaningful object value
Actual Behavior
Crashes with an error
Unhandled Exception: System.InvalidCastException: Unable to cast object of type 'PdfSharp.Pdf.PdfNull' to type 'PdfSharp.Pdf.AcroForms.PdfAcroForm'.
at PdfSharp.Pdf.Advanced.PdfCatalog.get_AcroForm()
at PdfSharp.Pdf.PdfDocument.get_AcroForm()
at IssueSubmission.Program.Main() in C:\Users\ofinka\Downloads\PDFsharp-IssueSubmission\IssueSubmission\Program.cs:line 25
It happens not with every pdf, but this one is critical for me.
Debugged a bit. Found that on parsing "/AcroForm" dictionary it can't find related object in irefTable - don't know why. That's why document.AcroForm == null.
PdfReader.cs:433 -> Parser.cs:187 -> Parser.cs:393 -> Parser.cs:486
It might be because your Test.pdf contains Javascript. Whereas Adobe (and various other products/libraries) support that, I don't believe it is a standard PDF feature (like XFA isn't a standard PDF feature) so I wouldn't necessarily expect PDFSharp to support it. That said, there should be a graceful or more meaningful handling of it.
Can't open document.AcroForm
Expected Behavior
it should be null or have some meaningful object value
Actual Behavior
Crashes with an error
It happens not with every pdf, but this one is critical for me.
Steps to Reproduce the Behavior
Just run IssueSubmission main project
PDFsharp-IssueSubmission.zip
The text was updated successfully, but these errors were encountered: