Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: PDF could not be generated! #1086

Open
Dimasfullxq opened this issue Dec 19, 2023 · 1 comment
Open

Error: PDF could not be generated! #1086

Dimasfullxq opened this issue Dec 19, 2023 · 1 comment

Comments

@Dimasfullxq
Copy link

Error: PDF could not be generated!

I have an error while generating PDF, but sometimes it works. 1 of 100 tries

/Users/dimasfullxq/.rvm/gems/ruby-3.2.1@online-consulting-backend/gems/wicked_pdf-2.6.3/lib/wicked_pdf.rb:80:in `rescue in pdf_from_url': Failed to execute: (RuntimeError)
["/Users/dimasfullxq/.rvm/gems/ruby-3.2.1@online-consulting-backend/bin/wkhtmltopdf", "--enable-local-file-access", "file:////var/folders/ng/0095qts9355cdj2_cp18z14c0000gn/T/wicked_pdf20231219-33636-1krr8o.html", "/var/folders/ng/0095qts9355cdj2_cp18z14c0000gn/T/wicked_pdf_generated_file20231219-33636-jnjpi5.pdf"]
Error: PDF could not be generated!
 Command Error: Loading pages (1/6)
Counting pages (2/6)                                               
[============================================================] Object 1 of 1
/Users/dimasfullxq/.rvm/gems/ruby-3.2.1@online-consulting-backend/gems/wicked_pdf-2.6.3/lib/wicked_pdf.rb:76:in `pdf_from_url': PDF could not be generated! (RuntimeError)
 Command Error: Loading pages (1/6)
Counting pages (2/6)                                               
[============================================================] Object 1 of 1

System specifications

wicked_pdf gem version (output of cat Gemfile.lock | grep wicked_pdf):
wicked_pdf (2.6.3)
wicked_pdf

wkhtmltopdf version (output of wkhtmltopdf --version): wkhtmltopdf 0.12.6 (with patched qt)

whtmltopdf provider gem and version if one is used: default binary

platform/distribution and version (e.g. Windows 10 / Ubuntu 16.04 / Heroku cedar): MacOs 14.1.2 (23B92), Intel

Rails 7.0.4 Ruby 3.2.1.
WickedPdf.config = {
enable_local_file_access: true
}

P.S Checked on test application with same rails and ruby version - works fine. Maybe you can support why I have such issue?

@slapsstick
Copy link

slapsstick commented Feb 21, 2024

The trip through the complexities of making PDF forms in development projects is always a journey full of learning courses and sometimes, unanticipated the barriers to them. The problem with wicked_pdf is very much akin to a glitch that I personally experienced a few months ago on a project that I was in charge of. In my journey of overcoming the same impediment, I discovered a useful resource that not only tackled what was immediate for me, but also boosted the security of the PDF files I used. It's a platform called PDF Guru https://pdfguru.com/password-protect-pdf , it is a one-stop-shop that combines advanced security measures and reliable features. This feature ended up being a game changer for me ensuring that confidential information was secured but lies in authority which is easy to access the authorized users. In fact, the process of finding technological obstacles enables us to stumble upon instruments that can return our working routine to normal and even improve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants