fillable-pdf 0.9.5.1 → 0.9.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fillable-pdf/version.rb +1 -1
- data/lib/fillable-pdf.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0217f9c6c445e4d79c0a8af4514547beb6297ef401659993097a5bb4be57b14
|
4
|
+
data.tar.gz: 6478016e8553f280217c0bc7f0a633f2cf8ac8aba6030639ef1a691d8b6d8aa7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff0ce41331cabc1b0cffc8aca6d5560e0a86855ad9cf1a705a1e5b15345c57e1e165c2a77b50f7fdc6c38e49f89308c1ffff851a98d14a9dbb0bdb735e994abd
|
7
|
+
data.tar.gz: 3a2e98246b9d7ddbd617bfd0552e2e4891dac0d6ba241f85d23603cc139b88eb2c6a2d0570e73d1a5178dffd1b3e3923f0e9ca0b47b5d7d34c5bfa622e23f996
|
data/lib/fillable-pdf/version.rb
CHANGED
data/lib/fillable-pdf.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require_relative 'fillable-pdf/itext'
|
2
2
|
require_relative 'field'
|
3
3
|
require 'base64'
|
4
|
-
require 'fileutils'
|
5
4
|
require 'securerandom'
|
5
|
+
require 'tmpdir'
|
6
6
|
|
7
7
|
class FillablePDF # rubocop:disable Metrics/ClassLength
|
8
8
|
##
|
@@ -148,7 +148,7 @@ class FillablePDF # rubocop:disable Metrics/ClassLength
|
|
148
148
|
# @param [String|Symbol] base64_image_data base64 encoded data image
|
149
149
|
#
|
150
150
|
def set_image_base64(key, base64_image_data)
|
151
|
-
tmp_file = SecureRandom.uuid
|
151
|
+
tmp_file = "#{Dir.tmpdir}/#{SecureRandom.uuid}"
|
152
152
|
File.binwrite(tmp_file, Base64.decode64(base64_image_data))
|
153
153
|
set_image(key, tmp_file)
|
154
154
|
ensure
|
@@ -214,7 +214,7 @@ class FillablePDF # rubocop:disable Metrics/ClassLength
|
|
214
214
|
# @param [bool] flatten true if PDF should be flattened, false otherwise
|
215
215
|
#
|
216
216
|
def save(flatten: false)
|
217
|
-
tmp_file = SecureRandom.uuid
|
217
|
+
tmp_file = "#{Dir.tmpdir}/#{SecureRandom.uuid}"
|
218
218
|
save_as(tmp_file, flatten: flatten)
|
219
219
|
FileUtils.mv tmp_file, @file_path
|
220
220
|
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.9.5.
|
4
|
+
version: 0.9.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vadim Kononov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|