Git Product home page Git Product logo

fillable-pdf's Introduction

Header

fillable-pdf's People

Contributors

jaehocho avatar matheusrich avatar tombroomfield avatar vkononov avatar vseguin avatar xxx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

fillable-pdf's Issues

Save to a specific folder

Hi,

Is there a way to save the output in a specific folder in my rails app please ? So far the .save_as method save the file to my root directory and passing the directory to the save_as option does not seem to work.

Thanks !

Gem Load Error: Constants DL and Fiddle is not defined.

Hello, I'm having trouble loading your library.

Expected Behavior

when typing rails server in the terminal, for the dev-server to start without error.

Current Behavior

  • error msg: There was an error while trying to load the gem 'fillable-pdf'. (Bundler::GemRequireError)
  • Gem Load Error is: Constants DL and Fiddle is not defined.
  • Typing require 'fiddle' in irb succeeds

Possible Solution

adding require: false to 'fillable-pdf' in Gemfile only pushes the error further down as RuntimeError

Steps to Reproduce

  • bundle with 'rjb', '~> 1.6.1' & 'fillable-pdf' in gemfile
  • try to start the server

Context (Environment)

  • Ubuntu 18.04 LTS
  • Ruby 2.3.8
  • Rails 5.2.3
  • Puma 3.11

Detailed Description

There was an error while trying to load the gem 'fillable-pdf'. (Bundler::GemRequireError) Gem Load Error is: Constants DL and Fiddle is not defined. Backtrace for gem load error is: /home/barracus/.rvm/gems/ruby-2.3.8/gems/fillable-pdf-0.7.1/lib/fillable-pdf/itext.rb:3:in load'
/home/barracus/.rvm/gems/ruby-2.3.8/gems/fillable-pdf-0.7.1/lib/fillable-pdf/itext.rb:3:in <main>' /home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require'
/home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in block in require_with_bootsnap_lfi' /home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in register'
/home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in require_with_bootsnap_lfi' /home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
/home/barracus/.rvm/gems/ruby-2.3.8/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in block in require' /home/barracus/.rvm/gems/ruby-2.3.8/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in load_dependency'
/home/barracus/.rvm/gems/ruby-2.3.8/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in require' /home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:48:in require_relative'
/home/barracus/.rvm/gems/ruby-2.3.8/gems/fillable-pdf-0.7.1/lib/fillable-pdf.rb:1:in <main>' /home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require'
/home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in block in require_with_bootsnap_lfi' /home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in register'
/home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in require_with_bootsnap_lfi' /home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
/home/barracus/.rvm/gems/ruby-2.3.8/gems/bundler-2.0.2/lib/bundler/runtime.rb:81:in block (2 levels) in require' /home/barracus/.rvm/gems/ruby-2.3.8/gems/bundler-2.0.2/lib/bundler/runtime.rb:76:in each'
/home/barracus/.rvm/gems/ruby-2.3.8/gems/bundler-2.0.2/lib/bundler/runtime.rb:76:in block in require' /home/barracus/.rvm/gems/ruby-2.3.8/gems/bundler-2.0.2/lib/bundler/runtime.rb:65:in each'
/home/barracus/.rvm/gems/ruby-2.3.8/gems/bundler-2.0.2/lib/bundler/runtime.rb:65:in require' /home/barracus/.rvm/gems/ruby-2.3.8/gems/bundler-2.0.2/lib/bundler.rb:114:in require'
/home/barracus/Documents/codes/ruby/rails/522/whizcharts/config/application.rb:20:in <main>' /home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require'
/home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in block in require_with_bootsnap_lfi' /home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in register'
/home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in require_with_bootsnap_lfi' /home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
/home/barracus/.rvm/gems/ruby-2.3.8/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in block in require' /home/barracus/.rvm/gems/ruby-2.3.8/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in load_dependency'
/home/barracus/.rvm/gems/ruby-2.3.8/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in require' /home/barracus/.rvm/gems/ruby-2.3.8/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:145:in block in perform'
/home/barracus/.rvm/gems/ruby-2.3.8/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in tap' /home/barracus/.rvm/gems/ruby-2.3.8/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in perform'
/home/barracus/.rvm/gems/ruby-2.3.8/gems/thor-0.19.4/lib/thor/command.rb:27:in run' /home/barracus/.rvm/gems/ruby-2.3.8/gems/thor-0.19.4/lib/thor/invocation.rb:126:in invoke_command'
/home/barracus/.rvm/gems/ruby-2.3.8/gems/thor-0.19.4/lib/thor.rb:369:in dispatch' /home/barracus/.rvm/gems/ruby-2.3.8/gems/railties-5.2.3/lib/rails/command/base.rb:65:in perform'
/home/barracus/.rvm/gems/ruby-2.3.8/gems/railties-5.2.3/lib/rails/command.rb:46:in invoke' /home/barracus/.rvm/gems/ruby-2.3.8/gems/railties-5.2.3/lib/rails/commands.rb:18:in

'
/home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require' /home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in block in require_with_bootsnap_lfi'
/home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in register' /home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in require_with_bootsnap_lfi'
/home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' /home/barracus/.rvm/gems/ruby-2.3.8/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in block in require'
/home/barracus/.rvm/gems/ruby-2.3.8/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in load_dependency' /home/barracus/.rvm/gems/ruby-2.3.8/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in require'
bin/rails:6:in <main>' Bundler Error Backtrace: from /home/barracus/.rvm/gems/ruby-2.3.8/gems/bundler-2.0.2/lib/bundler/runtime.rb:80:in block (2 levels) in require'
from /home/barracus/.rvm/gems/ruby-2.3.8/gems/bundler-2.0.2/lib/bundler/runtime.rb:76:in each' from /home/barracus/.rvm/gems/ruby-2.3.8/gems/bundler-2.0.2/lib/bundler/runtime.rb:76:in block in require'
from /home/barracus/.rvm/gems/ruby-2.3.8/gems/bundler-2.0.2/lib/bundler/runtime.rb:65:in each' from /home/barracus/.rvm/gems/ruby-2.3.8/gems/bundler-2.0.2/lib/bundler/runtime.rb:65:in require'
from /home/barracus/.rvm/gems/ruby-2.3.8/gems/bundler-2.0.2/lib/bundler.rb:114:in require' from /home/barracus/Documents/codes/ruby/rails/522/whizcharts/config/application.rb:20:in '
from /home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require' from /home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in block in require_with_bootsnap_lfi'
from /home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in register' from /home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in require_with_bootsnap_lfi'
from /home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from /home/barracus/.rvm/gems/ruby-2.3.8/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in block in require'
from /home/barracus/.rvm/gems/ruby-2.3.8/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in load_dependency' from /home/barracus/.rvm/gems/ruby-2.3.8/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in require'
from /home/barracus/.rvm/gems/ruby-2.3.8/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:145:in block in perform' from /home/barracus/.rvm/gems/ruby-2.3.8/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in tap'
from /home/barracus/.rvm/gems/ruby-2.3.8/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in perform' from /home/barracus/.rvm/gems/ruby-2.3.8/gems/thor-0.19.4/lib/thor/command.rb:27:in run'
from /home/barracus/.rvm/gems/ruby-2.3.8/gems/thor-0.19.4/lib/thor/invocation.rb:126:in invoke_command' from /home/barracus/.rvm/gems/ruby-2.3.8/gems/thor-0.19.4/lib/thor.rb:369:in dispatch'
from /home/barracus/.rvm/gems/ruby-2.3.8/gems/railties-5.2.3/lib/rails/command/base.rb:65:in perform' from /home/barracus/.rvm/gems/ruby-2.3.8/gems/railties-5.2.3/lib/rails/command.rb:46:in invoke'
from /home/barracus/.rvm/gems/ruby-2.3.8/gems/railties-5.2.3/lib/rails/commands.rb:18:in <main>' from /home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require'
from /home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in block in require_with_bootsnap_lfi' from /home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in register'
from /home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in require_with_bootsnap_lfi' from /home/barracus/.rvm/gems/ruby-2.3.8/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
from /home/barracus/.rvm/gems/ruby-2.3.8/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in block in require' from /home/barracus/.rvm/gems/ruby-2.3.8/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in load_dependency'
from /home/barracus/.rvm/gems/ruby-2.3.8/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in require' from bin/rails:6:in '
`

Handling extended characters in form fields

Thank you so much for this gem!

I need to fill form fields with strings that may contain special characters, namely the card suit symbols ♠ ♥︎ ♦ ♣. Right now, they are just getting dropped from the text.

I've read some articles on how itext will drop such characters, and you need to set a font using BaseFont, but I don't see how to do that from Rails. ITEXT::BaseFont is not recognized.

Thank you for your help.

Rails 6 compatibility

After upgrading Rails to version 6.0.0, I received this error after running a task:

/.rvm/gems/ruby-2.6.3/gems/fillable-pdf-0.7.1/lib/field.rb:4: warning: already initialized constant Rjb::Com_itextpdf_kernel_pdf_PdfName::A
/.rvm/gems/ruby-2.6.3/gems/fillable-pdf-0.7.1/lib/field.rb:4: warning: previous definition of A was here
/.rvm/gems/ruby-2.6.3/gems/fillable-pdf-0.7.1/lib/field.rb:4: warning: already initialized constant Rjb::Com_itextpdf_kernel_pdf_PdfName::R
/.rvm/gems/ruby-2.6.3/gems/fillable-pdf-0.7.1/lib/field.rb:4: warning: previous definition of R was here

ERROR: Error installing fillable-pdf

Hello, I'm getting the same error installation than my previous issue #41

extconf.rb:54:in `<main>': JAVA_HOME is not set. (RuntimeError)

although than it seems I have set JAVA_HOME ? and installed JDK

$ echo $JAVA_HOME
/usr/local/jdk-1.8.0/

$ pkg_info -Q jdk
debug-jdk-1.8.0.362.b09.1p1v0
debug-jdk-11.0.18.10.1p0v0
debug-jdk-17.0.6.10.1p0v0
jdk-1.8.0.362.b09.1p1v0 (installed)
jdk-11.0.18.10.1p0v0
jdk-17.0.6.10.1p0v0 (installed)

In my ~/.kshrc I added export JAVA_HOME=/usr/local/jdk-1.8.0

Missing national characters

Any idea what I'm doing wrong or what should I change?

In any fields with value included national characters, proper value is displayed only when field is "clicked/active"

In printout or preview national characters are invisible.

Working OKey only when I input manually (from Adobe Reader or macOs preview) values with national characters.

The issue is only when I fill form from RoR application (UTF-8 as default for app and DB).

Examples as attached.

Zrzut ekranu 2022-07-7 o 14 48 02

Zrzut ekranu 2022-07-7 o 14 51 00

Use /tmp directory for base64 images

I was trying to use this on AWS Lambda and it's read-only. Using /tmp would be more friendly for this type of env. Can submit a PR if you want

Constant DL and Fiddile is not defined

Hello,
Anytime I try to run my server I get this error

load the gem 'fillable-pdf'. (Bundler::GemRequireError)
Gem Load Error is: Constants DL and Fiddle is not defined.
Backtrace for gem load error is:
/home/chubiyojo/.rvm/gems/ruby-2.6.3/gems/fillable-pdf-0.7.1/lib/fillable-pdf/itext.rb:3:in load' /home/chubiyojo/.rvm/gems/ruby-2.6.3/gems/fillable-pdf-0.7.1/lib/fillable-pdf/itext.rb:3:in

'
/home/chubiyojo/.rvm/gems/ruby-2.6.3/gems/bootsnap-

Gem hangs passenger phusion when trying to generate filled pdfs in controller actions

I know there are some issues with this gem and the application server or things like spring, but I figured it would not conflict with more modern application servers but that does not seem to be the case. Has anyone seen an issue with passenger phusion and generation of PDF's on the fly in controllers. I will say I did add one function to the FillablePDF class to add a function to make streaming PDF content easier.

class FillablePDF
   def pdf_bytes(flatten: false)
     @pdf_form.flattenFields if flatten
     close
     @byte_stream.toByteArray
   end
end

Using puma locally everything works fine, but once the code is deployed to phusion the request hangs and eventually hangs all of the web requests to the server.

Thanks in advance for any ideas on how to make this gem place nicely with passenger.

National characters

Any idea what I'm doing wrong or what should I change?

In any fields with value included national characters, proper value is displayed only when field is "clicked/active"

In printout or preview national characters are invisible.

When I input manually values with national characters, all characters are OKey.

Issue is only when I fill form from RoR application (UTF-8 as default for app and DB).

Examples are attached.
Zrzut ekranu 2022-07-7 o 14 48 02
Zrzut ekranu 2022-07-7 o 14 51 00

How to use fillable pdf gem in Rubymine on Windows

I've installed fillable-pdf in my rubymine. The methods, coming from FillablePdf class are accessible. However, when I am trying to run my feature file, it gives me the following error `import': NoClassDefFoundError. My Java_Home is set. and I am using Windows 10, ruby version is 2.4.0 . Could you pls help me on this

Hangs when deployed to Heroku running Puma

Using the app with Puma locally works perfectly, but hosting it on Heroku (with Puma as well) makes the code hang, whenever FillablePDF.new is called. Have you experienced the hanging with Puma as well?

Gem on Ruby

What is required to use this gem with JRuby?

ERROR: Error installing fillable-pdf

Hello, I have an issue in the installation

$ gem install fillable-pdf

Building native extensions. This could take a while...
ERROR:  Error installing fillable-pdf:
	ERROR: Failed to build gem native extension.

    current directory: /usr/local/lib/ruby/gems/3.2/gems/rjb-1.6.7/ext
/usr/local/bin/ruby32 extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/usr/local/bin/$(RUBY_BASE_NAME)32
extconf.rb:54:in `<main>': JAVA_HOME is not set. (RuntimeError)

extconf failed, exit code 1

Gem files will remain installed in /usr/local/lib/ruby/gems/3.2/gems/rjb-1.6.7 for inspection.
Results logged to /usr/local/lib/ruby/gems/3.2/extensions/x86_64-openbsd/3.2/rjb-1.6.7/gem_make.out

Do I need to install Java or set a JAVA_HOME env var ?

Ruby and Gem version: 3.2
OS: OpenBSD 7.3

Setting Checkbox Values and Formatting

Setting Checkbox Values

When using set_values, it seems like if any value is set to the checkbox's key, including nil, the checkbox will be checked. The only way to uncheck the box was to remove it's associate key from the hash of values passed to that method.

Checkbox Display

After a checkbox value has been set to 'Yes' or 'Off', the actual formatting is different from what I would expect. For example, 'Off'/unchecked check boxes seem to be set to an empty square, and 'Yes'/checked boxes display both an empty box and an offset X.

Expected

Screen Shot 2022-09-14 at 10 34 09 AM

(I also see this in my PDF, though the above image is closer to what I'd expect)
Screen Shot 2022-09-14 at 10 31 05 AM

Actual

Screen Shot 2022-09-14 at 10 30 07 AM

Checkboxes not able to uncheck

When filling a form with simple checkboxes in it, cannot uncheck the boxes and passing any value even nil makes the checkboxes appear checked. Looking at the pdf in adobe the values used are appearing as export values.
values tried:
true
false
"No"
"Yes"
"NO"
"YES"
""
nil
"true"
"false"
"True"
"False"
1
0
"1"
"0"

Project hangs after deploying to AWS server.

begin
pdf = FillablePDF.new(Rails.root.to_s + '/public/pdf_contracts/' + contract.template_name)
rescue Exception => e
Rails.logger.info('exception - ***')
Rails.logger.info(e.message)
ensure
Rails.logger.info('reached ensure block ')
end

So hang the server when i try to create the pdf from .new and didnt even through exception neither ensure msg displayed on production.log.

No spec around the Field::SIGNATURE feature

My team is considering using this library, but there are no specs included for what it looks like to include a signature in a document. What use case is supported here:

  • A signature in image format, like perhaps a base64 string? (this would be best aligned with my project's use case)
  • A digital signature? (which is what I suspect after looking at the iText SDK - but which wouldn't address my team's use case)
  • Some other format for the signature?

Would greatly appreciate feedback from the team! Glad to also contribute updates to the spec if you can point me in the right direction for what this looks like, perhaps with a gist showing it in use, or link to a sample project?

Constantly getting NoSuchField error on new setup

Hi @vkononov,

I've been trying to add fillable-pdf to a new project, both locally and in Heroku.
I am using version 0.9.6 (latest) version here, but have the same problem with earlier versions. Note that between versions, the NoSuchFieldError error message changes (and stack trace as well) but still.

Getting the following error while opening any PDF file:

rake aborted!
NoSuchFieldError: LEFT
/Users/vincentseguin/.rvm/gems/ruby-3.3.0/gems/fillable-pdf-0.9.6/lib/fillable-pdf/itext.rb:14:in `import'
/Users/vincentseguin/.rvm/gems/ruby-3.3.0/gems/fillable-pdf-0.9.6/lib/fillable-pdf/itext.rb:14:in `block in <module:ITEXT>'
/Users/vincentseguin/.rvm/gems/ruby-3.3.0/gems/fillable-pdf-0.9.6/lib/fillable-pdf/suppress_warnings.rb:6:in `suppress_warnings'
/Users/vincentseguin/.rvm/gems/ruby-3.3.0/gems/fillable-pdf-0.9.6/lib/fillable-pdf/itext.rb:10:in `<module:ITEXT>'
/Users/vincentseguin/.rvm/gems/ruby-3.3.0/gems/fillable-pdf-0.9.6/lib/fillable-pdf/itext.rb:7:in `<class:FillablePDF>'
/Users/vincentseguin/.rvm/gems/ruby-3.3.0/gems/fillable-pdf-0.9.6/lib/fillable-pdf/itext.rb:6:in `<top (required)>'
/Users/vincentseguin/.rvm/gems/ruby-3.3.0/gems/fillable-pdf-0.9.6/lib/fillable-pdf.rb:1:in `require_relative'
/Users/vincentseguin/.rvm/gems/ruby-3.3.0/gems/fillable-pdf-0.9.6/lib/fillable-pdf.rb:1:in `<top (required)>'
/Users/vincentseguin/Desktop/dev/deployment/lib/tasks/continuation_page.rake:3:in `<top (required)>'
/Users/vincentseguin/.rvm/gems/ruby-3.3.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
/Users/vincentseguin/.rvm/gems/ruby-3.3.0/bin/ruby_executable_hooks:22:in `eval'
/Users/vincentseguin/.rvm/gems/ruby-3.3.0/bin/ruby_executable_hooks:22:in `<main>'
(See full trace by running task with --trace)

My code is (assume myfile is a pdf file here)

pdf = FillablePDF.new 'myfile.pdf'

My Java version is

bash-3.2$ java -version
openjdk version "11.0.22" 2024-01-16
OpenJDK Runtime Environment Homebrew (build 11.0.22+0)
OpenJDK 64-Bit Server VM Homebrew (build 11.0.22+0, mixed mode)

Using Ruby 3.3.0 as a Ruby version.

I've tried the same on a brand new Rails app, and also in Heroku - always getting the same error.

Any guidance would be great!

Checkbox values not being set when using 0.9.5

Using the following PDF form:
claim-template.pdf

And setting the following fields:

pdf.set_fields({
  "assignment.yes".to_sym => "Yes",
  "relation.self".to_sym => "Yes",
  "insurance_type.7".to_sym => "Yes",
  "sex.male".to_sym => "Yes"
})

We expect the checkboxes corresponding to the above fields to be checked.

In 0.9.4, they were checked:
image

In 0.9.5, they are not:
image

Issue with reading the file in FillablePDF outside console

File not found as file or resource. (input file may be corrupt, incompatible, or may not have any forms)
I am receiving the above mentioned error when doing FillablePDF.new(path) inside my models or controllers, however it seems to work fine when I do it from rails console.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.