fillable-pdf 0.5 → 0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0c5cc5a9b62b1f5af8cae176bd12b091b4c0b974
4
- data.tar.gz: f5e7d046aa370c15f4e830cd09663b07cf8db78d
3
+ metadata.gz: 2e531a833cf7701b907be49fc29b6885241bc2d5
4
+ data.tar.gz: e59582332f1377cd3bbef6d5fe53adf02f8e764b
5
5
  SHA512:
6
- metadata.gz: 9eb1596cfc4cd89146237536a0391d1fd59867f5343e3181a6c09d089356c577c5da788417ab38ef8cfbb8b024284cb6732c71719ddb32eb84ba7dd487cd051c
7
- data.tar.gz: 75eee8c3150bf8cad77af4908a7d6239f40371468379301cd1cd5568490f27ab23b6fe475dee6dceea6900e551f290158fbf52504e50151ea9c220f20acb659c
6
+ metadata.gz: c021fe8a59d2397e3e54174d1cd109e40b3aa0fe740296f39582aeaa486ef0e302139aed079ec729a0cfde465d81c90c09bd756278bcf5591cced8bc15636dc5
7
+ data.tar.gz: aadd836fbfa70a083dd76b71ea1766b53fb0f2eafb8bba1a5ede6267a7e13abaafbd5dc9be767de6ce962b1c1f9ad1ef3d726c23f74c0c3ced4e815efffc179a
data/README.md CHANGED
@@ -7,6 +7,11 @@ FillablePDF is an extremely simple and lightweight utility that bridges iText an
7
7
 
8
8
  ## Installation
9
9
 
10
+ **Ensure that your `JAVA_HOME` variable is set before installing this gem (see examples below).**
11
+
12
+ * OSX: `/Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home`
13
+ * Ubuntu/CentOS: `/usr/lib/jvm/java-1.8.0-openjdk`
14
+
10
15
  Add this line to your application's Gemfile:
11
16
 
12
17
  gem 'fillable-pdf'
@@ -39,15 +44,21 @@ An instance of `FillablePDF` has the following methods at its disposal:
39
44
  # return true if the form has any fillable fields
40
45
  # output example: true
41
46
  pdf.any_fields?
47
+ ```
42
48
 
49
+ ```ruby
43
50
  # get the total number of fillable form fields
44
51
  # output example: 10
45
52
  pdf.num_fields
53
+ ```
46
54
 
55
+ ```ruby
47
56
  # retrieve a single field value by field name
48
57
  # output example: 'Richard'
49
58
  pdf.get_field(:full_name)
59
+ ```
50
60
 
61
+ ```ruby
51
62
  # retrieve a numeric field type by field value
52
63
  # numeric types should
53
64
  # output example: 4
@@ -62,32 +73,46 @@ Field::PUSHBUTTON
62
73
  Field::RADIOBUTTON
63
74
  Field::SIGNATURE
64
75
  Field::TEXT
76
+ ```
65
77
 
78
+ ```ruby
66
79
  # retrieve a hash of field name and values
67
80
  # output example: {:last_name=>"Rahl", :first_name=>"Richard"}
68
81
  pdf.get_fields
82
+ ```
69
83
 
84
+ ```ruby
70
85
  # set the value of a single field by field name
71
86
  # result: changes the value of 'first_name' to 'Richard'
72
87
  pdf.set_field(:first_name, 'Richard')
88
+ ```
73
89
 
90
+ ```ruby
74
91
  # set the values of multiple fields by field names
75
92
  # result: changes the values of 'first_name' and 'last_name'
76
93
  pdf.set_fields(first_name: 'Richard', last_name: 'Rahl')
94
+ ```
77
95
 
96
+ ```ruby
78
97
  # rename field (i.e. change the name of the field)
79
98
  # this action also moves the field to the end of the hash
80
99
  # result: renames field name 'last_name' to 'surname'
81
100
  pdf.rename_field(:last_name, :surname)
101
+ ```
82
102
 
103
+ ```ruby
83
104
  # remove field (i.e. delete field and its value)
84
105
  # result: physically removes field 'last_name' from document
85
106
  pdf.remove_field(:last_name)
107
+ ```
86
108
 
109
+ ```ruby
87
110
  # get an array of all field names in the document
88
111
  # output example: [:first_name, :last_name]
89
112
  pdf.keys
113
+ ```
90
114
 
115
+ ```ruby
91
116
  # get an array of all field values in the document
92
117
  # output example: ["Rahl", "Richard"]
93
118
  pdf.values
@@ -1,5 +1,3 @@
1
- # coding: utf-8
2
-
3
1
  lib = File.expand_path('../lib', __FILE__)
4
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
3
  require 'fillable-pdf/version'
@@ -20,5 +18,6 @@ Gem::Specification.new do |spec|
20
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
19
  spec.require_paths = %w[ext lib]
22
20
 
21
+ spec.requirements << '>= JDK 5.0'
23
22
  spec.add_runtime_dependency 'rjb', '~> 1.5'
24
23
  end
@@ -11,4 +11,4 @@ class Field
11
11
  RADIOBUTTON = ACRO_FIELDS.FIELD_TYPE_RADIOBUTTON
12
12
  SIGNATURE = ACRO_FIELDS.FIELD_TYPE_SIGNATURE
13
13
  TEXT = ACRO_FIELDS.FIELD_TYPE_TEXT
14
- end
14
+ end
@@ -2,7 +2,6 @@ require_relative 'fillable-pdf/itext'
2
2
  require_relative 'field'
3
3
  require 'securerandom'
4
4
 
5
-
6
5
  class FillablePDF
7
6
  # required Java imports
8
7
  BYTE_STREAM = Rjb.import('java.io.ByteArrayOutputStream')
@@ -1,4 +1,4 @@
1
1
  require 'rjb'
2
2
 
3
3
  # http://github.com/itext/itextpdf/releases/latest
4
- Rjb.load(File.expand_path('../../ext/itext5-itextpdf-5.5.11.jar', __dir__))
4
+ Rjb.load(File.expand_path('../../ext/itext5-itextpdf-5.5.12.jar', __dir__))
@@ -1,3 +1,3 @@
1
1
  module FillablePDF
2
- VERSION = '0.5'.freeze
2
+ VERSION = '0.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fillable-pdf
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.5'
4
+ version: '0.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vadim Kononov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-19 00:00:00.000000000 Z
11
+ date: 2017-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rjb
@@ -40,7 +40,7 @@ files:
40
40
  - Rakefile
41
41
  - bin/console
42
42
  - bin/setup
43
- - ext/itext5-itextpdf-5.5.11.jar
43
+ - ext/itext5-itextpdf-5.5.12.jar
44
44
  - fillable-pdf.gemspec
45
45
  - lib/field.rb
46
46
  - lib/fillable-pdf.rb
@@ -65,9 +65,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  - - ">="
66
66
  - !ruby/object:Gem::Version
67
67
  version: '0'
68
- requirements: []
68
+ requirements:
69
+ - ">= JDK 5.0"
69
70
  rubyforge_project:
70
- rubygems_version: 2.6.11
71
+ rubygems_version: 2.6.13
71
72
  signing_key:
72
73
  specification_version: 4
73
74
  summary: Fill out or extract field values from simple fillable PDF forms using iText.