On Wed, 15 May 2013 15:56:27 +0200, Mester József <mesterj...@gmail.com> wrote:
> Hello > > I have 2 pdf with fillable fields. > The second pdf has 2 pages and the page one is same as the pdf 1. > When I get fields from pdf 2 i have got totally different order of > fields than pdf1 . > I would like get field from page 1 and after page 2. > Because of my filler program is made for pdf 1, and don't want totally > rewrite for 2 pages pdf. > > Or how can I read fields from one page only? There's a method getFieldPositions() that returns an ArrayList of FieldPosition objects. See http://api.itextpdf.com/itext/com/itextpdf/text/pdf/AcroFields.html#getFieldPositions(java.lang.String) and http://api.itextpdf.com/itext/com/itextpdf/text/pdf/AcroFields.FieldPosition.html Why an ArrayList? Because a single field can be present on different pages at different positions. What is this FieldPosition about? It contains the page number and the coordinates of the rectangle where the widget annotation is drawn. This information can help you answer your question, but I have a more important question: why do you think you need to rewrite your program based on the position of your fields? iText doesn't care in which order you fill out fields. If you pass a correct field name, iText will find that field where ever it's visualized in the document. ------------------------------------------------------------------------------ AlienVault Unified Security Management (USM) platform delivers complete security visibility with the essential security capabilities. Easily and efficiently configure, manage, and operate all of your security controls from a single console and one unified framework. Download a free trial. http://p.sf.net/sfu/alienvault_d2d _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php