Check out this code: http://github.com/jaywhy/pdf-stamper/tree/master
I haven't used it, as it wasn't around when I needed it, so I wrote my own,
but this code looks very similar to what I wrote, so it may work well for
what you need.

The highlighted line in this link shows how the fields can be listed:

http://github.com/jaywhy/pdf-stamper/blob/3f1f6bd7867994bd9124b8b1ffa613007903d22a/lib/pdf/stamper/rjb.rb#L35

--
Benjamin Curtis
http://railskits.com/ - Ready-made Rails code
http://catchthebest.com/ - Team-powered recruiting
http://www.bencurtis.com/ - Personal blog



On Sun, May 24, 2009 at 11:59 PM, Dan Sadaka <
[email protected]> wrote:

>
> Hello everyone,
>
> Has anyone used iText to list all fields on a PDF AcroForm?
> There are plenty of java examples to do it, but I do not know how to
> translate that into ruby.  I'm using Rjb.
>
> The Java example I've found is:
>
> AcroFields form = reader.getAcroFields();
> HashMap fields = form.getFields();
> String key;
> for (Iterator i = fields.keySet().iterator(); i.hasNext(); ) {
>  key = (String) i.next();
>  System.out.print(key + ": ");
>  switch(form.getFieldType(key)) {
>    case AcroFields.FIELD_TYPE_CHECKBOX:
>      System.out.println("Checkbox");
>      break;
>    case... (other types)
>  }
> }
>
> TIA,
> Dan
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to