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

Unable to render any charts/javascript in pdf #817

Open
achaves06 opened this issue Mar 22, 2019 · 2 comments
Open

Unable to render any charts/javascript in pdf #817

achaves06 opened this issue Mar 22, 2019 · 2 comments

Comments

@achaves06
Copy link

Issue description

When creating the pdf no charts or content created as part of javascripts is rendered. I have tried multiple versions of chart.js as well as Google Charts. Neither works. Displaying as html works perfectly. Also, trying to set responsive: false in the chart.js config results in a runtime error Could not load Page (1/6)

Expected or desired behavior

Charts should be shown just like they do in the html view.

System specifications

wicked_pdf gem version : wicked_pdf (1.2.1)

wkhtmltopdf version : wkhtmltopdf 0.12.4 (with patched qt)

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

platform/distribution and version (e.g. Windows 10 / Ubuntu 16.04 / Heroku cedar): Ubuntu 18.04

@quadur
Copy link

quadur commented Apr 26, 2019

I can confirm that, we have the same problem - simple vanilla JS works well but when we include our application.js in the header with <%= wicked_pdf_javascript_include_tag 'application', 'data-turbolinks-track' => true %> and try to use any jquery function it just stops parsing javascript (even that simple vanilla js line stops working).

In the debug mode all works well, our gem versions.

wicked_pdf 1.2.2
wkhtmltopdf-binary-edge 0.12.5.0
platform: ubuntu 18.04.2

@Wmeng98
Copy link

Wmeng98 commented Jun 30, 2020

I wonder if this issue is related to a dependency on the libssl1.0-dev package? Can you try installing that?
apt-get install libssl1.0-dev
Though it isn't recommended that you downgrade your libssl it does fix the issue of chart generation for older versions of wkhtmltopdf.

The issue with wkhtmltopdf and libssl compatibility should be fixed on v0.12.5 as well.

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

3 participants