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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8b685f435c8356edc53a47ca0581ae1fa71c57cb23876b12e3ba7bef0d4aa99
4
- data.tar.gz: 84f4dcd7ac4d566493dcc37a3ea3e7d776c6f8a28b1129465304ad198c2a7530
3
+ metadata.gz: e0217f9c6c445e4d79c0a8af4514547beb6297ef401659993097a5bb4be57b14
4
+ data.tar.gz: 6478016e8553f280217c0bc7f0a633f2cf8ac8aba6030639ef1a691d8b6d8aa7
5
5
  SHA512:
6
- metadata.gz: 575e161cc77a304578997b4d2f967019df98382be944b0fbfd1f6e171e97545bf265a84c2b70a1a80515de520517c303fcfdf27db48ce64c0bae3a292832e6a7
7
- data.tar.gz: aaaf3eee62d9886660ca753b3a06495d73ba9092d10a56e415bc5283a0056a9418d53ce9df1bda8d7030ed723e93cd1473a59107515800a6715da05eaacf7da5
6
+ metadata.gz: ff0ce41331cabc1b0cffc8aca6d5560e0a86855ad9cf1a705a1e5b15345c57e1e165c2a77b50f7fdc6c38e49f89308c1ffff851a98d14a9dbb0bdb735e994abd
7
+ data.tar.gz: 3a2e98246b9d7ddbd617bfd0552e2e4891dac0d6ba241f85d23603cc139b88eb2c6a2d0570e73d1a5178dffd1b3e3923f0e9ca0b47b5d7d34c5bfa622e23f996
@@ -1,3 +1,3 @@
1
1
  class FillablePDF
2
- VERSION = '0.9.5.1'
2
+ VERSION = '0.9.5.2'
3
3
  end
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.1
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-19 00:00:00.000000000 Z
11
+ date: 2022-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler