Skip to content

Crash on get document.AcroForm #114

@oleg-finka

Description

@oleg-finka

Can't open document.AcroForm

Expected Behavior

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.

Steps to Reproduce the Behavior

Just run IssueSubmission main project
PDFsharp-IssueSubmission.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions