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

PDFs won't load Javascript #44

Closed
Pelimak opened this issue Oct 12, 2013 · 3 comments
Closed

PDFs won't load Javascript #44

Pelimak opened this issue Oct 12, 2013 · 3 comments

Comments

@Pelimak
Copy link

Pelimak commented Oct 12, 2013

I don't know if this is a problem with my set up of CakePDF, or if this is just impossible with the current plugin, but I cannot get any PDF to actually read/execute Javascript. If I have an html page with just html and php, the page will generate just fine; however, it will skip anything in Javascript tags. I really need to be able to use Javascript when the PDF is created so that I can create the images I need to be on the document. I am using wkhtmltopdf as the engine.

I apologize if this has been answered before, but in days of researching the problem and experimenting with possible solutions, I have found no information on getting Javascript to work. I would greatly appreciate any help in this matter. Thanks.

@ceeram
Copy link
Member

ceeram commented Oct 13, 2013

afaik wkhtmltopdf has javascript enabled by default and a delay of 200,
CakePdf responsibilty it to render your view templates to generate the
html. Are you using external ,js scripts(jquery etc) or only pure
javascript in a script tag?

2013/10/13 Pelimak notifications@github.com

I don't know if this is a problem with my set up of CakePDF, or if this is
just impossible with the current plugin, but I cannot get any PDF to
actually read/execute Javascript. If I have an html page with just html and
php, the page will generate just fine; however, it will skip anything in
Javascript tags. I really need to be able to use Javascript when the PDF is
created so that I can create the images I need to be on the document. I am
using wkhtmltopdf as the engine.

I apologize if this has been answered before, but in days of researching
the problem and experimenting with possible solutions, I have found no
information on getting Javascript to work. I would greatly appreciate any
help in this matter. Thanks.


Reply to this email directly or view it on GitHubhttps://github.com//issues/44
.

@Pelimak
Copy link
Author

Pelimak commented Oct 13, 2013

I'm using only pure javascript. If I do something very simple like <script type="text/javascript">alert("test");</script> it will not do the alert. I also tried having it change the text of an html span to see if it was just alerts that did not work; however, that did not do anything either.

@dakota
Copy link
Member

dakota commented May 31, 2015

Closing due to inactivity. This sounds like a problem with wkhtmltopdf (If it is possible at all).

@dakota dakota closed this as completed May 31, 2015
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