We need to get the PpdfPage that contains an especific PdfTextField, how can we do it?
Code:
PdfDocument document = PdfReader.Open("C:\\filex.pdf", PdfDocumentOpenMode.Modify);
// Get the root object of all interactive form fields
PdfAcroForm form = document.AcroForm;
// Get all form fields of the whole document
PdfAcroField.PdfAcroFieldCollection fields = form.Fields;
PdfTextField textfield1= (PdfTextField)fields["textfield1"];
//how to get the correct page reference respect the especified field?
PdfPage page = textfield1.Owner.Pages[???];
In the end we solved it creating this function:
Not the best solution but it works…if someone adds a better one we will give the correct answer to him/her