We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Finding form fields of a specific page

Thread ID:

Created:

Updated:

Platform:

Replies:

102360 Jan 24,2012 07:16 AM UTC Feb 14,2018 12:07 PM UTC WinForms 3
loading
Tags: PDF
Guido Schrage
Asked On January 24, 2012 07:16 AM UTC

Hi everybody,

I want to get the form fields placed on a specific page. But only the PdfDocument class has the Form.Fields collection I have to loop through comparing the PdfField.Page property with another PdfPage object to get to know on which page the PdfField is placed.

I need something like that:

foreach (PdfField field in pdfPage.Form.Fields)
{
...
}

At the moment I have to loop through the whole PdfDocument to find fields of a specific (2nd) page:

foreach (PdfField field in pdfDocument.Form.Fields)
{
if (pdfDocument.Pages.IndexOf(field.Page) == 1)
break;
}

Regards


George Livingston [Syncfusion]
Replied On January 27, 2012 12:54 PM UTC

Hi Guido,

Thank you for using Syncfusion products.

Currently we do not have support to get the form field for the specific page. However we have added a feature request for this implementation. We will let you know once the feature has been implemented. For further follow can you please create a Direct-Trac incident.

Please let us know if you have any questions.

Regards,
George



Todd J
Replied On February 13, 2018 04:16 PM UTC

Hi George;
Is the there way to find page number of a form field?
Thanks

Sowmiya Loganathan [Syncfusion]
Replied On February 14, 2018 12:07 PM UTC

Hi Guido, 

We can get the page number of a form field in the PDF document. Please refer the below code snippet for more details: 

            //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)); 
                    } 
                } 
            } 


We have created the sample for the same. Please find the sample link from below: 

Please try the above sample in your end and let us know if it meets your requirement. If not please let us know the further details regarding your requirements. It will be helpful for us to analyze further and assist you better. 

Regards, 
Sowmiya L 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;