fillable-pdf-th 1.0.0 → 1.0.1
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 +4 -4
- data/.rubocop.yml +1 -1
- data/README.md +8 -8
- data/bin/console +1 -1
- data/fillable-pdf-th.gemspec +2 -2
- data/lib/field.rb +1 -1
- data/lib/{fillable-pdf.rb → fillable-pdf-th.rb} +2 -2
- data/lib/{fillable-pdf → fillable-pdf-th}/itext.rb +0 -0
- data/lib/fillable-pdf-th/version.rb +3 -0
- metadata +4 -4
- data/lib/fillable-pdf/version.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2dab2de8e322ae58fc8caf400a2b5f18e66bf51a6ec87ce54fa2f9b2175e72d
|
4
|
+
data.tar.gz: f59dfab7a5d1bc7e4345b07c351a680ca626e57f0f6ae28163e5bf8811ff7b75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1159e931fa9ef4a0e23268eea1228f1606fb6b1bdca0454050c51f2dcf0892e243d35dce898c3dd3b8661e07ec35bd174f5a5a1da7860aa4cb8afe227c1988f1
|
7
|
+
data.tar.gz: 58eb4bf392f70fcf83e5f5fbfa8088a4eece102e692223306a4847ad25d3dd8d4098cb6869b02f85d11f2957e2acd6878aff2121cb3ac47bf47d1c556138207e
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
@@ -14,7 +14,7 @@ FillablePDF is an extremely simple and lightweight utility that bridges iText an
|
|
14
14
|
|
15
15
|
Add this line to your application's Gemfile:
|
16
16
|
|
17
|
-
gem 'fillable-pdf'
|
17
|
+
gem 'fillable-pdf-th'
|
18
18
|
|
19
19
|
And then execute:
|
20
20
|
|
@@ -22,12 +22,12 @@ And then execute:
|
|
22
22
|
|
23
23
|
Or install it yourself as:
|
24
24
|
|
25
|
-
gem install fillable-pdf
|
25
|
+
gem install fillable-pdf-th
|
26
26
|
|
27
27
|
If you are using this gem in a script, you need to require it manually:
|
28
28
|
|
29
29
|
```ruby
|
30
|
-
require 'fillable-pdf'
|
30
|
+
require 'fillable-pdf-th'
|
31
31
|
```
|
32
32
|
|
33
33
|
## Usage
|
@@ -35,10 +35,10 @@ require 'fillable-pdf'
|
|
35
35
|
First of all, you should open a fillable PDF file:
|
36
36
|
|
37
37
|
```ruby
|
38
|
-
pdf =
|
38
|
+
pdf = FillablePDFTH.new 'input.pdf'
|
39
39
|
```
|
40
40
|
|
41
|
-
An instance of `
|
41
|
+
An instance of `FillablePDFTH` has the following methods at its disposal:
|
42
42
|
|
43
43
|
```ruby
|
44
44
|
fillable-pdf
|
@@ -148,10 +148,10 @@ pdf.save_as('output.pdf', flatten: true)
|
|
148
148
|
The following example [example.rb](example/run.rb) and the input file [input.pdf](example/input.pdf) are located in the `test` directory. It uses all of the methods that are described above and generates the output files [output.pdf](example/output.pdf) and [output.flat.pdf](example/output.flat.pdf).
|
149
149
|
|
150
150
|
```ruby
|
151
|
-
require 'fillable-pdf'
|
151
|
+
require 'fillable-pdf-th'
|
152
152
|
|
153
153
|
# opening a fillable PDF
|
154
|
-
pdf =
|
154
|
+
pdf = FillablePDFTH.new('input.pdf')
|
155
155
|
|
156
156
|
# total number of fields
|
157
157
|
if pdf.any_fields?
|
@@ -210,7 +210,7 @@ puts "Signatory: #{pdf.field(:first_name)} #{pdf.field(:last_name)}"
|
|
210
210
|
pdf.save_as('output.pdf')
|
211
211
|
|
212
212
|
# saving another copy of the filled out PDF in another file and making it non-editable
|
213
|
-
pdf =
|
213
|
+
pdf = FillablePDFTH.new('output.pdf')
|
214
214
|
pdf.save_as 'output.flat.pdf', flatten: true
|
215
215
|
```
|
216
216
|
|
data/bin/console
CHANGED
data/fillable-pdf-th.gemspec
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
lib = File.expand_path('lib', __dir__)
|
2
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
-
require 'fillable-pdf/version'
|
3
|
+
require 'fillable-pdf-th/version'
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'fillable-pdf-th'
|
7
|
-
spec.version =
|
7
|
+
spec.version = FillablePDFTH::VERSION
|
8
8
|
spec.authors = ['Swiftlet']
|
9
9
|
spec.email = ['swiftlet.dev@gmail.com']
|
10
10
|
|
data/lib/field.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
require_relative 'fillable-pdf/itext'
|
1
|
+
require_relative 'fillable-pdf-th/itext'
|
2
2
|
require_relative 'field'
|
3
3
|
require 'securerandom'
|
4
4
|
|
5
|
-
class
|
5
|
+
class FillablePDFTH
|
6
6
|
# required Java imports
|
7
7
|
BYTE_STREAM = Rjb.import 'com.itextpdf.io.source.ByteArrayOutputStream'
|
8
8
|
PDF_READER = Rjb.import 'com.itextpdf.kernel.pdf.PdfReader'
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fillable-pdf-th
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Swiftlet
|
@@ -92,9 +92,9 @@ files:
|
|
92
92
|
- fillable-pdf-th.gemspec
|
93
93
|
- lib/default-font/angsana_new.ttf
|
94
94
|
- lib/field.rb
|
95
|
-
- lib/fillable-pdf.rb
|
96
|
-
- lib/fillable-pdf/itext.rb
|
97
|
-
- lib/fillable-pdf/version.rb
|
95
|
+
- lib/fillable-pdf-th.rb
|
96
|
+
- lib/fillable-pdf-th/itext.rb
|
97
|
+
- lib/fillable-pdf-th/version.rb
|
98
98
|
homepage: https://github.com/swiftlet-dev/fillable-pdf-th
|
99
99
|
licenses:
|
100
100
|
- MIT
|
data/lib/fillable-pdf/version.rb
DELETED