How to extract form field data from Static XFA PDF Forms?

53 views
Skip to first unread message

Ashish Sethi

unread,
Sep 13, 2020, 6:23:51 PM9/13/20
to PDF::Reader
Hi,

Is there a way to extract form field data from static XFA PDF form using PDF::Reader gem?

Thanks!

-Ashish

James Healy

unread,
Sep 16, 2020, 10:59:55 AM9/16/20
to pdf-r...@googlegroups.com
Hi Ashish,

Out of the box there's no helpers for extracting PDF Form data, but
it's possible to manually find most (all?) data inside a PDF.

I'm not particularly familiar with XFA PDF forms, however if you print
out the resources for a page and poke around, I suspect you'll find
some data.

require 'pdf/reader'

PDF::Reader.open("somefile.pdf") do |reader|
reader.pages.each do |page|
puts page.resources.inspect
end
end

James
> --
> You received this message because you are subscribed to the Google Groups "PDF::Reader" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pdf-reader+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pdf-reader/0d0ef1ab-a9c5-43a4-b9b3-ad5cce1857c2n%40googlegroups.com.

Ashish Sethi

unread,
Sep 16, 2020, 5:02:22 PM9/16/20
to PDF::Reader
Thanks, James!
Reply all
Reply to author
Forward
0 new messages