All form fields are not identified from the pdf, I can share the pdf that I am using in a private email, not sure whether I can share the pdf in public forum as it is related to insurance industry.
we use currently iTextSharp on production.
//iTextSharp code to get all the acrofields is below:
temppdfReader = new PdfReader(pdfTemplate);
tempStamper = new PdfStamper(temppdfReader, new FileStream(pdfNew, FileMode.Create));
AcroFields fields = tempStamper.AcroFields;
Am trying same using aspose, but its retrieving only 4 out of 16 fields on the pdf.
Approach 1 using Aspose:
var dataDir = GetDataDir_Data();
var pdfDocument = new Document(dataDir + "sample-doc.pdf");
return pdfDocument.Form.Fields;
As suggested on this forum I also tried below code:
Approach 2:
var dataDir = GetDataDir_Data();
var pdfDocument = new Document(dataDir + “sample-doc.pdf”);
pdfDocument.Form.XFA.FieldNames;
Approach 3:
fs = new FileStream(dataDir + “sample-doc.pdf”, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
var pdfDocument = new Document(fs);
formFields = pdfDocument.Form.XFA.FieldNames;