Typically, I am able to access form fields on a PDF using something like the following
Hi Nathan,
Sorry for the late reply - here’s a link to the form I’m having an issue with:
Hi Nathan,
Aspose.Pdf.Document doc= new Aspose.Pdf.Document(“c:/pdftest/njw3m.pdf”); <o:p></o:p>
Console.WriteLine("Total Number of Fields = "+ doc.Form.Fields.Length);
int counter=1;
//document initialization code here
foreach (Aspose.Pdf.InteractiveFeatures.Forms.Field field in doc.Form.Fields)
{
Console.WriteLine(counter+":- "+ field.FullName) ;
counter+=1;
}
var field2 = doc.Form["dateoftpsig2"];
Can you please try using the latest release and in case the problem still persists, please share the code snippet which can help us in replicating this issue at our end. We are sorry for your inconvenience.
Hi Nathan,
//open document<o:p></o:p>
Document pdfDocument = new Document(myDir + "njw3m.pdf");
FormType formType = pdfDocument.Form.Type;
//Get the PDF form
Aspose.Pdf.InteractiveFeatures.Forms.Form form = pdfDocument.Form;
//get the form fields in Field array
Aspose.Pdf.InteractiveFeatures.Forms.Field[] fields = form.Fields;
//Display Field names and values
foreach (Field field in fields)
{
field.Value = "testvalue-" + field.FullName;
}
//Flatten the PDF form
pdfDocument.Flatten();
pdfDocument.Save(myDir + "Fillablefields_out.pdf");
Please feel free to contact us for any further assistance.
Best Regards,