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)
Paul Rayman Posted: Thursday, October 15, 2020 3:05:17 AM(UTC)
 
Hello,

The same field can be displayed on multiple pages. For visual representation of the field, controls are used. Here is the example
https://forum.patagames....e-a-Field-is-On#post1562
jmlilly Posted: Wednesday, October 7, 2020 10:39:22 AM(UTC)
 
I need to open a multi-page pdf and extract the values in the fields. I either need to do this page by page, or I need to determine which page each field is on.
How do I do this?


I can do this:
Code:
 var forms = new PdfForms();
 var frm = PdfDocument.Load(fqn, forms);
 foreach (var field in forms.InterForm.Fields)
 {
     if (field.FieldType == Patagames.Pdf.Enums.FormFieldTypes.FPDF_FORMFIELD_TEXTFIELD)
     {
          switch (field.FullName.ToUpper().Trim())
          {

            ... and then evaluate the fields I'm looking for


But isn't this looking at the entire collection of fields for the entire document? Nothing here determines which page the field is on.

I can also do this:
Code:
using (var doc = PdfDocument.Load(fqn)) // C# Read PDF File
{
     foreach (var pg in doc.Pages)
     {
          // Here I'm stuck.  I can't figure out how to get to forms fields from here.


          p++;
          pg.Dispose();
     }
}


Note fqn is my fully qualified file name, a string