fillable-pdf-th 1.0.4 → 1.0.5.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/lib/fillable-pdf-th.rb +26 -2
- data/lib/fillable-pdf-th/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f3431c63ef922659e2dd4ecbe20660916db83ecd7afd9760c119ce9628e297e
|
4
|
+
data.tar.gz: 65a6b060a11db4b54068bcf3251718b802221b156e14067a34625097c9c43d72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27ca7c228af1a364757bb078d5ca5ebd89f993b2d532286f26b29c9a4b5c2d1d7f88bc09e16302bf0f1ed2b571936c2d418371a7dffe002a2d00d90f907b33d9
|
7
|
+
data.tar.gz: 9272f113dc7e46c5e9f99a312b73ef6c553f70d8597f75a15826a4e68ea91368a35010f391b96ec35b3a407074c5e66bdf4d9018f2577cc0464c6db297a97ffd
|
data/lib/fillable-pdf-th.rb
CHANGED
@@ -42,11 +42,35 @@ class FillablePDFTH
|
|
42
42
|
set_checkbox_style
|
43
43
|
end
|
44
44
|
|
45
|
+
##
|
46
|
+
# get position field
|
47
|
+
##
|
48
|
+
def get_position(key)
|
49
|
+
rectangle = pdf_field(key).getWidgets().get(0).getRectangle()
|
50
|
+
position = []
|
51
|
+
position << rectangle.getAsNumber(0).getValue()
|
52
|
+
position << rectangle.getAsNumber(1).getValue()
|
53
|
+
position << rectangle.getAsNumber(2).getValue()
|
54
|
+
position << rectangle.getAsNumber(3).getValue()
|
55
|
+
position
|
56
|
+
end
|
57
|
+
|
58
|
+
##
|
59
|
+
# get dimention form field
|
60
|
+
##
|
61
|
+
def get_dimention(key)
|
62
|
+
position = pdf_field(key).getWidgets().get(0).getRectangle()
|
63
|
+
width = position.getAsNumber(2).getValue() - position.getAsNumber(0).getValue();
|
64
|
+
height = position.getAsNumber(3).getValue() - position.getAsNumber(1).getValue();
|
65
|
+
return width, height
|
66
|
+
end
|
67
|
+
|
45
68
|
##
|
46
69
|
# Set font in PDF file
|
47
70
|
#
|
48
|
-
def set_font(font_path=FONT)
|
49
|
-
@pdf_font = PDF_FONT_FACTORY.createFont(font_path, PDF_FONT_ENCODE.IDENTITY_H)
|
71
|
+
def set_font(font_path=FONT, embeded=false, cache=false, subset=false)
|
72
|
+
@pdf_font = PDF_FONT_FACTORY.createFont(font_path, PDF_FONT_ENCODE.IDENTITY_H, embeded, cache)
|
73
|
+
@pdf_font.setSubset(subset)
|
50
74
|
end
|
51
75
|
|
52
76
|
def set_checkbox_style(mark_style='check')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Swiftlet
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -115,8 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '0'
|
117
117
|
requirements: []
|
118
|
-
|
119
|
-
rubygems_version: 2.7.9
|
118
|
+
rubygems_version: 3.0.3
|
120
119
|
signing_key:
|
121
120
|
specification_version: 4
|
122
121
|
summary: Fill out or extract field values from simple fillable PDF forms using iText.
|