pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barry Neu <barry....@gmail.com>
Subject Re: PDAcroForm.getFieldIterator() Question
Date Mon, 12 Sep 2016 15:16:33 GMT
Is there any way to influence the order the fields occur in the field tree when creating fillable
forms or otherwise?

> On Sep 9, 2016, at 4:44 PM, John Hewson <john@jahewson.com> wrote:
> 
> 
>> On 9 Sep 2016, at 15:15, Barry Neu <barry.neu@gmail.com> wrote:
>> 
>> Hello.
>> 
>> The API docs for this method state an iterator is returned which "walks all fields
in the field tree, in order”.
>> Is the order left to right, top to bottom on the form .. I was hoping?
>> I was hoping it was but ehe following code seems to prove otherwise.
> 
> It's not a visual order. It's simply the order in which the fields occur in the field
tree. This has no relation to where fields appear on the page.
> 
> -- John
> 
>> PDDocument pdDoc = getTemplate("http://localhost:8000/template/Template_MA_ABJ4580MAG5_EF_L70SS_v5.pdf
<http://localhost:8000/template/Template_MA_ABJ4580MAG5_EF_L70SS_v5.pdf>");
>> PDAcroForm pdAcroForm = pdDoc.getDocumentCatalog().getAcroForm();
>> Iterator<PDField> iter = pdAcroForm.getFieldIterator();
>> while (iter.hasNext()) {
>>      PDField field = iter.next();
>>      String fieldName = field.getPartialName();
>>      System.out.println("field partial name: " + fieldName );
>> }
>> 
>> PDF in question is here:     https://github.com/BarryNeu/shared <https://github.com/BarryNeu/shared>
>> 
>> Thanks in advance.
>> Barry
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message