Print Page | Close Window

Order of field name retrieval

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: General Discussion
Forum Description: Discussion board for Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=351
Printed Date: 23 Nov 24 at 12:28AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Order of field name retrieval
Posted By: jabaltie
Subject: Order of field name retrieval
Date Posted: 07 Mar 06 at 7:07AM
I use Open Office version 2.0 to design my PDF with empty form fields (a template PDF).

Then, I have an utility of mine that "reads" the PDF and lists the form fields that this PDF contains.The purpose of this utility is to generate a source code to be pasted into my original code. Something like PDFformfieldname="".

Then I do :

FOR index=1 TO formfieldcount
formfieldname=getformfieldtitle(index)
NEXT

Finally : the problem is that the FOR/NEXT above sometimes wont retrieve the field names on the order they appear at the PDF.

Is there a way to make this field name retrieval to be done on a TAB ORDER manner ? Or, at least to retrieve some other information from the fields, such as their positioning, so that I could classify the field names ?

Because my generated source code gets messed up, that is, the fields are listed not on the order that they appear on the page...

Thanks in advance for your support !



Replies:
Posted By: jabaltie
Date Posted: 07 Mar 06 at 7:22AM
Another idea that I've just had : from this utility of mine, I can load the whole PDF into a string and then, try to find out some more information from it, even if QuickPDF does not return it to me.

I just need to know what I have to look for, that is, where in the PDF I can find either the tab order or the field positioning.

Here's like a field declaration looks like, when I open the PDF as a text file :

6 0 obj
<< /Type /Annot
   /Subtype /Widget
   /F 4
   /Rect [58.6 643.8 124.9 656.7]
   /FT /Tx
   /P 1 0 R
   /T (TCOPROCESSO)
   /TU <FEFF>
   /V <FEFF>
   /DV <FEFF>
   /DR << /Font 45 0 R >>
   /DA (0 0 0 rg /HelvReg 8 Tf)
   /AP <<
     /N 51 0 R
   >>
>>
endobj

Where's the field positioning (or the tab order) on the field declaration above ?


Posted By: bogey
Date Posted: 07 Mar 06 at 7:30AM

Use the loop to retrieve the list of all the form fields and retrieve the tab order at the same time. Place both pieces of information in an 2 dimensional array.

dim formfieldArray(formFieldCount,2)

FOR index=1 TO formfieldcount 

  formfieldArray(index,0) = QP.getFormFieldTabOrder(index)

  formfieldArray(index,1) = QP.getformfieldtitle(index)

NEXT

Then sort the array by the array column 0 using whatever sort algorythmn you want.



Posted By: jabaltie
Date Posted: 07 Mar 06 at 7:51AM
Ops, of course !

I didnt remeber there was a GetFormfieldTabOrder function !

Once I have it in hand, sorting it is a piece of cake !

Issue closed.

Thanks !



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk