0.0
No commit activity in last 3 years
No release in over 3 years
fill text through acroform fields, gem based in ruby-fillform
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
 Project Readme

ruby-fill-form: Fill Text and Images through Acroform Fields

Install

$ gem install ruby-fillform

Usage

Create a PDF form with LibreOffice or something else. I have only tested this with LibreOffice. Currently only text fields, check box and buttons are supported.

require 'ruby-fillform'

data = {}
data[:page_1] = {}
data[:page_1][:name] = { value: 'Josue Merlos' }
data[:page_1][:address] = { value: 'My Address' }

# Page number optional, substitute lastname var in all pages, thanks to hoverlover
data[:lastname] = { value: 'Merlos' }

# Create a PDF file with predefined data Fields
Prawn::Document.generate 'output.pdf', template: 'template.pdf'  do |pdf|
  pdf.fill_form_with(data)
end

Take a look in examples repo

https://github.com/JosueMerlos/ruby-fillform-example.git

#And on a per-form basis

See the :options param below

require 'ruby-fill-form'

data = {}
data[:page_1] = {}
data[:page_1][:name] = { value: 'Josue Merlos', options: {x_offset: 2, y_offset: -40} }
data[:page_1][:address] = { value: 'My Address' }

# Create a PDF file with predefined data Fields
Prawn::Document.generate 'output.pdf', template: 'template.pdf'  do |pdf|
  pdf.fill_form_with(data)
end