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

unable to check if a PdfDocument has an AcroForm inside #115

Open
fedebona opened this issue May 6, 2024 · 0 comments
Open

unable to check if a PdfDocument has an AcroForm inside #115

fedebona opened this issue May 6, 2024 · 0 comments

Comments

@fedebona
Copy link

fedebona commented May 6, 2024

Reporting an Issue Here

If I open a PdfDocument
PdfDocument inputPDFDocument = PdfReader.Open(pdfFile, PdfDocumentOpenMode.Import);

I'm not able to check if it has an AcroForm inside.

Expected Behavior

I should be able to check something like
inputPDFDocument.AcroForm != null

Actual Behavior

inputPDFDocument.AcroForm raises an invalidoperation exception

Steps to Reproduce the Behavior

bool hasForm = (inputPDFDocument.AcroForm != null && inputPDFDocument.AcroForm.Elements.Count > 0);
//unwanted Exception raised

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