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[???];
(we need the page reference in order to insert an image in the position where the pdftextfield is, more details:
http://stackoverflow.com/questions/13120562/pdfsharp-insert-an-image-in-a-pdf-using-a-pdftextfield-as-the-position-and-size)