Skip to content

Instantly share code, notes, and snippets.

@gxespino
Created January 17, 2018 03:44
Show Gist options
  • Save gxespino/6f880d57be97c4ed368e9c8a82baf5a1 to your computer and use it in GitHub Desktop.
Save gxespino/6f880d57be97c4ed368e9c8a82baf5a1 to your computer and use it in GitHub Desktop.
require 'pdf_forms'
require 'cliver'
input_data = {
ssn: '123-23-1234',
birthday: '02/14/1980',
color: 'Excella Red',
first_name: 'John Smith'
}
@pdftk = PdfForms.new(Cliver.detect('pdftk'))
fill_values = {}
fill_values['ssn'] = input_data[:ssn]
fill_values['birthday'] = input_data[:birthday]
fill_values['color'] = input_data[:color]
fill_values['first name'] = input_data[:first_name]
@pdftk.fill_form './Fillable.pdf', 'dynamic.pdf', fill_values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment