diff --git a/README.md b/README.md index 802f0f0..07542b0 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ FillablePDF is an extremely simple and lightweight utility that bridges iText an **Prerequisites:** Java SE Development Kit v8, v11 -- Ensure that your `JAVA_HOME` variable is set before installing this gem (see examples below).** +- Ensure that your `JAVA_HOME` variable is set before installing this gem (see examples below). * OSX: `/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home` * Ubuntu/CentOS: `/usr/lib/jvm/java-1.8.0-openjdk` diff --git a/example/output.flat.pdf b/example/output.flat.pdf index f61f675..d86656f 100644 Binary files a/example/output.flat.pdf and b/example/output.flat.pdf differ diff --git a/example/output.pdf b/example/output.pdf index 2f591a0..98c2fc3 100644 Binary files a/example/output.pdf and b/example/output.pdf differ diff --git a/ext/commons-7.2.3.jar b/ext/commons-7.2.3.jar new file mode 100755 index 0000000..7dfb88f Binary files /dev/null and b/ext/commons-7.2.3.jar differ diff --git a/ext/font-asian-7.1.17.jar b/ext/font-asian-7.2.3.jar similarity index 98% rename from ext/font-asian-7.1.17.jar rename to ext/font-asian-7.2.3.jar index 73fb081..17053cd 100755 Binary files a/ext/font-asian-7.1.17.jar and b/ext/font-asian-7.2.3.jar differ diff --git a/ext/forms-7.1.17.jar b/ext/forms-7.1.17.jar deleted file mode 100755 index 1c63c67..0000000 Binary files a/ext/forms-7.1.17.jar and /dev/null differ diff --git a/ext/forms-7.2.3.jar b/ext/forms-7.2.3.jar new file mode 100755 index 0000000..d620e21 Binary files /dev/null and b/ext/forms-7.2.3.jar differ diff --git a/ext/io-7.1.17.jar b/ext/io-7.1.17.jar deleted file mode 100755 index bb11706..0000000 Binary files a/ext/io-7.1.17.jar and /dev/null differ diff --git a/ext/io-7.2.3.jar b/ext/io-7.2.3.jar new file mode 100755 index 0000000..a15de15 Binary files /dev/null and b/ext/io-7.2.3.jar differ diff --git a/ext/kernel-7.1.17.jar b/ext/kernel-7.1.17.jar deleted file mode 100755 index b6826fd..0000000 Binary files a/ext/kernel-7.1.17.jar and /dev/null differ diff --git a/ext/kernel-7.2.3.jar b/ext/kernel-7.2.3.jar new file mode 100755 index 0000000..d95486e Binary files /dev/null and b/ext/kernel-7.2.3.jar differ diff --git a/ext/layout-7.1.17.jar b/ext/layout-7.1.17.jar deleted file mode 100755 index 74f0aa0..0000000 Binary files a/ext/layout-7.1.17.jar and /dev/null differ diff --git a/ext/layout-7.2.3.jar b/ext/layout-7.2.3.jar new file mode 100755 index 0000000..09c6568 Binary files /dev/null and b/ext/layout-7.2.3.jar differ diff --git a/fillable-pdf.gemspec b/fillable-pdf.gemspec index dae58b6..d59f405 100644 --- a/fillable-pdf.gemspec +++ b/fillable-pdf.gemspec @@ -30,7 +30,8 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rubocop-performance' spec.add_development_dependency 'rubocop-rake' - spec.add_runtime_dependency 'rjb', '1.6.2' + spec.add_runtime_dependency 'rjb', '~> 1.6' + spec.requirements << 'JDK 8.x - 11.x' spec.metadata = { 'rubygems_mfa_required' => 'true' diff --git a/lib/fillable-pdf.rb b/lib/fillable-pdf.rb index fc580a6..8134c6b 100644 --- a/lib/fillable-pdf.rb +++ b/lib/fillable-pdf.rb @@ -145,7 +145,7 @@ def set_image(key, file_path) # rubocop:disable Metrics/AbcSize, Metrics/MethodL # def set_image_base64(key, base64_image_data) tmp_file = SecureRandom.uuid - File.open(tmp_file, 'wb') { |f| f.write(Base64.decode64(base64_image_data)) } + File.binwrite(tmp_file, Base64.decode64(base64_image_data)) set_image(key, tmp_file) ensure FileUtils.rm tmp_file diff --git a/lib/fillable-pdf/itext.rb b/lib/fillable-pdf/itext.rb index 10c2eed..2f3150b 100644 --- a/lib/fillable-pdf/itext.rb +++ b/lib/fillable-pdf/itext.rb @@ -8,7 +8,7 @@ module ITEXT ByteArrayOutputStream = Rjb.import 'com.itextpdf.io.source.ByteArrayOutputStream' Canvas = Rjb.import 'com.itextpdf.layout.Canvas' Div = Rjb.import 'com.itextpdf.layout.element.Div' - HorizontalAlignment = Rjb.import 'com.itextpdf.layout.property.HorizontalAlignment' + HorizontalAlignment = Rjb.import 'com.itextpdf.layout.properties.HorizontalAlignment' Image = Rjb.import 'com.itextpdf.layout.element.Image' ImageDataFactory = Rjb.import 'com.itextpdf.io.image.ImageDataFactory' PdfAcroForm = Rjb.import 'com.itextpdf.forms.PdfAcroForm' @@ -19,6 +19,6 @@ module ITEXT PdfReader = Rjb.import 'com.itextpdf.kernel.pdf.PdfReader' PdfWriter = Rjb.import 'com.itextpdf.kernel.pdf.PdfWriter' Rectangle = Rjb.import 'com.itextpdf.kernel.geom.Rectangle' - VerticalAlignment = Rjb.import 'com.itextpdf.layout.property.VerticalAlignment' + VerticalAlignment = Rjb.import 'com.itextpdf.layout.properties.VerticalAlignment' end end diff --git a/lib/fillable-pdf/version.rb b/lib/fillable-pdf/version.rb index 78c23cc..d64c2f2 100644 --- a/lib/fillable-pdf/version.rb +++ b/lib/fillable-pdf/version.rb @@ -1,3 +1,3 @@ class FillablePDF - VERSION = '0.9.3' + VERSION = '0.9.4' end diff --git a/test/pdf_test.rb b/test/pdf_test.rb index 365f9f6..8fb0f72 100644 --- a/test/pdf_test.rb +++ b/test/pdf_test.rb @@ -23,11 +23,11 @@ def test_that_an_error_is_thrown_for_non_existing_file end def test_that_file_has_editable_fields - assert @pdf.any_fields? + assert_predicate @pdf, :any_fields? end def test_that_file_has_a_positive_number_of_editable_fields - assert @pdf.num_fields.positive? + assert_predicate @pdf.num_fields, :positive? end def test_that_hash_can_be_accessed