//Load the PDF document.
PdfLoadedDocument document = new PdfLoadedDocument("Form.pdf");
//Get all the form fields.
PdfLoadedForm loadedForm = document.Form;
PdfLoadedFormFieldCollection fieldCollection = loadedForm.Fields;
//Check the page number of the field.
foreach (PdfLoadedField field in fieldCollection)
{
for (int i = 0; i < document.Pages.Count; i++)
{
if (field.Page == document.Pages[i])
{
Console.WriteLine(field.Name + " - Page no is " + (i + 1));
}
}
} |