logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Post a reply
From:
Message:

Maximum number of characters in each post is: 32767
Bold Italic Underline   Highlight Quote Choose Language for Syntax Highlighting Insert Image Insert an existing Attachment or upload a new File... Create Link   Unordered List Ordered List   Left Justify Center Justify Right Justify   Outdent Indent   More BBCode Tags
Font Color Font Size
Security Image:
Enter The Letters From The Security Image:
  Preview Post Cancel

Last 10 Posts (In reverse order)
stan Posted: Friday, February 22, 2019 8:03:51 AM(UTC)
 
Thank you very much!
Paul Rayman Posted: Thursday, February 21, 2019 10:16:57 PM(UTC)
 
Hi,

The field is not associated with the page directly. This is an entity whose visual presentation is carried out by means of PdfControls. Each PdfFeld has one or more controls. Each control associated with the one page. (and yes, that does mean what field can be associated with several pages).

You can get the list of controls for the page and check if desired control contained by the list.

Please look at code

Code:
var forms = new PdfForms();
var document = PdfDocument.Load(filename, forms);

var disiredControl = yourField.Controls[0];

for (int i = 0; i < document.Pages.Count; i++)
{
    var controls = forms.InterForm.GetPageControls(document.Pages[i]);

    foreach (var ctrl in controls)
    {
        if(desiredControl.Dictionary.Handle == ctrl.Dictionary.Handle)
        {
            //Got it!
            break;
        }
    }
}
stan Posted: Thursday, February 21, 2019 1:41:25 PM(UTC)
 

Hi,

I need to get the page a field is on.

Thank You