Rank: Member
Groups: Registered
Joined: 2/21/2019(UTC) Posts: 15
|
Hi,
I need to get the page a field is on.
Thank You
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
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;
}
}
}
|
|
|
|
|
|
Rank: Member
Groups: Registered
Joined: 2/21/2019(UTC) Posts: 15
|
|
|
|
|
|
|
Forum Jump
You can post new topics in this forum.
You can reply to topics in this forum.
You can delete your posts in this forum.
You can edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close