I just wrote a short (two lines, which I'll post below) app to test the free, NuGet-available Spire.PDF to try and read a PDF and get its form fields. I've tried it with two files (It says I can't post URLs, but I think they're probably important so I've added spaces and replaced periods with commas. My apologies for the trouble. www , ppt , gc , ca / form / pdfs / pptc153 , pdf and www , uspto , gov / forms / aia0014 , pdf) and neither seem to be working. My two lines are as follows:
- Code: Select all
Spire.Pdf.PdfDocument doc = new Spire.Pdf.PdfDocument();
doc.LoadFromFile("{downloaded file path}");
After executing them, I've been looking through the doc variable with a Watch window and I've found that doc.Form.Fields is an empty collection.
Curiously, it seems that the USPTO form isn't getting loaded at all. doc.Pages only has one item and when I save it to an image, that image is blank. This is not the case for the PPT one, but it still doesn't show as having any form fields.
Am I missing a step? Or is there something (security-wise, maybe? or the wrong format?) that could be doing this by design?
Thanks,
Matthew