README.md in fillable-pdf-0.5 vs README.md in fillable-pdf-0.6
- old
+ new
@@ -5,10 +5,15 @@
FillablePDF is an extremely simple and lightweight utility that bridges iText and Ruby in order to fill out fillable PDF forms or extract field values from previously filled out PDF forms.
## Installation
+**Ensure that your `JAVA_HOME` variable is set before installing this gem (see examples below).**
+
+* OSX: `/Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home`
+* Ubuntu/CentOS: `/usr/lib/jvm/java-1.8.0-openjdk`
+
Add this line to your application's Gemfile:
gem 'fillable-pdf'
And then execute:
@@ -37,19 +42,25 @@
```ruby
# return true if the form has any fillable fields
# output example: true
pdf.any_fields?
+```
+```ruby
# get the total number of fillable form fields
# output example: 10
pdf.num_fields
+```
+```ruby
# retrieve a single field value by field name
# output example: 'Richard'
pdf.get_field(:full_name)
+```
+```ruby
# retrieve a numeric field type by field value
# numeric types should
# output example: 4
pdf.get_field_type(:football)
@@ -60,35 +71,49 @@
Field::NONE
Field::PUSHBUTTON
Field::RADIOBUTTON
Field::SIGNATURE
Field::TEXT
+```
+```ruby
# retrieve a hash of field name and values
# output example: {:last_name=>"Rahl", :first_name=>"Richard"}
pdf.get_fields
+```
+```ruby
# set the value of a single field by field name
# result: changes the value of 'first_name' to 'Richard'
pdf.set_field(:first_name, 'Richard')
+```
+```ruby
# set the values of multiple fields by field names
# result: changes the values of 'first_name' and 'last_name'
pdf.set_fields(first_name: 'Richard', last_name: 'Rahl')
+```
+```ruby
# rename field (i.e. change the name of the field)
# this action also moves the field to the end of the hash
# result: renames field name 'last_name' to 'surname'
pdf.rename_field(:last_name, :surname)
+```
+```ruby
# remove field (i.e. delete field and its value)
# result: physically removes field 'last_name' from document
pdf.remove_field(:last_name)
+```
+```ruby
# get an array of all field names in the document
# output example: [:first_name, :last_name]
pdf.keys
+```
+```ruby
# get an array of all field values in the document
# output example: ["Rahl", "Richard"]
pdf.values
```
\ No newline at end of file