See the example DumpFields.java in my site.

Best Regards,
Paulo Soares

> -----Original Message-----
> From: Yongfu Ge [SMTP:[EMAIL PROTECTED]
> Sent: Monday, March 24, 2003 16:40
> To:   [EMAIL PROTECTED]
> Subject:      [iText-questions] How to get the coordinate of a PDF form
> field?
> 
> Hi members,
> 
> How can I get the coordiantes of form fields from a exsiting pdf file?
> I can get the list of the field names but have no idea on how to
> retrieve the cooresponding coordinate vlaues (/Rect values ) for each
> text field.
> Here is the code I used. Any advise will be appreciated
> 
>          PdfDictionary dic;
>          PdfAnnotation ano;
>          PdfObject pobj;
>          String field, name;
>          PRAcroForm$FieldInformation fi;         
> 
>          PdfReader reader = new
> PdfReader("myExistingPdf_with_Form_text_fields");
>          PRAcroForm  acroForm = reader.getAcroForm ();
>          ArrayList fields =  acroForm.getFields();
>          Iterator iter =  fields.iterator();
>          
>          while (iter.hasNext())
>          {
>             fi = (PRAcroForm$FieldInformation)iter.next();
>             name = fi.getName();
>            //print form field name: works fine
>            System.err.println"field name " +  name); 
> 
>            dic = fi.getInfo();
>             pobj = dic.get(PdfName.RECT);
>             if (pobj!=null)  // always null here
>             {
>                System.err.println(name +  ": " +
> ((PdfRectangle)pobj).left() + " " +
>                                  ((PdfRectangle)pobj).right() + " " +
>                                  ((PdfRectangle)pobj).top() + " " +
>                                  ((PdfRectangle)pobj).bottom());      
>       }
>        } //while
> 
> 
> 
> Thanks.
> 
> Yongfu
> 
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to