Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fill out PDF forms with pdftk (http://www.accesspdf.com/pdftk/).
Ruby
branch: master

This branch is 38 commits behind jkraemer:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
Gemfile
Gemfile.lock
History.txt
LICENSE
README.rdoc
Rakefile
pdf-forms.gemspec

README.rdoc

pdf-forms

http://github.com/jkraemer/pdf-forms/
by Jens Kraemer, jk@jkraemer.net

DESCRIPTION:

Fill out PDF forms with pdftk (www.accesspdf.com/pdftk/).

EXAMPLE:

FDF creation

require 'pdf_forms'
fdf = PdfForms::Fdf.new :key => 'value', :other_key => 'other value'
# use to_fdf if you just want the fdf data, without writing it to a file
puts fdf.to_fdf
# write fdf file
fdf.save_to 'path/to/file.fdf'

Query form fields and fill out PDF forms with pdftk

First get pdftk from www.accesspdf.com/pdftk/ and install it.

require 'pdf_forms'

# adjust the pdftk path to suit your pdftk installation
pdftk = PdfForms.new('/usr/local/bin/pdftk')

# find out the field names that are present in form.pdf
pdftk.get_field_names 'path/to/form.pdf'

# take form.pdf, set the 'foo' field to 'bar' and save the document to myform.pdf
pdftk.fill_form '/path/to/form.pdf', 'myform.pdf', :foo => 'bar'

INSTALL:

$ gem install pdf-forms

CODE:

$ git clone http://github.com/jkraemer/pdf-forms.git

Prior Art

The FDF generation part is a straight port of Steffen Schwigon's PDF::FDF::Simple perl module. Didn't port the FDF parsing, though ;-)

LICENSE:

see LICENSE

Something went wrong with that request. Please try again.