I am trying to update some form fields on a pdf but before I update the field, I need to check to see if the field is on the pdf of not. Is there a method that I can use to do that?
Form Fields
Re: Form Fields
Support · Jan 23, 2014Hello,
There is no specific method or property available to check whether a form field exists or not. You can try and access the form field as shown below in an if statement and compare the result with null value.
//read the PDF document
PdfDocument pdf = new PdfDocument(@"Filledfw9AcroForm_03.pdf");
MergeDocument mergeDocument = new MergeDocument(pdf);
//access the form field to see if it exists.
if (mergeDocument.Form.Fields["field name here"] != null)
{
//field exists.
}
else
{
//field does not exist.
}
Thanks,
ceTe Software Support Team.