-
-
Notifications
You must be signed in to change notification settings - Fork 704
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
Javascript generated content #454
Comments
Short answer: unfortunately, no. You'll find some interesting comments in #23 explaining how you can add some generated content using Python. That's the easiest way to do this currently. |
@sander76 I wanted this feature in order to run a JS syntax highlighter. Check out this SO answer: https://stackoverflow.com/questions/12450868/how-to-print-html-source-to-console-with-phantomjs/12469284#12469284 As a pre-PDF step, I'm running my HTML through PhantomJS and writing the output to a new file, which now includes DOM manipulations from JS, and using that to feed into WeasyPrint. Worth noting that Prince can do this just fine by using the |
GitHub ruined the link to SO ... try this one: |
As we won't include a JS engine in WeasyPrint, I close this issue. Using a preprocessing JS tool is the best solution if you want to rely on JS, otherwise editing the document with Python (or anything else) is possible too. |
Hi, can you show some example how to do this? I'm trying to figure out this to implement a template with JS that render maps em graphs. I use Django and I've read some people saying to use PhantomJS to render the page in the front end and give it back to Weasy. Some thing like this: |
@drukepple thank you for your answer ! could you please give an exemple ? what do you mean by "I'm running my HTML through PhantomJS" please ? thanks a lot ! how do you get the DOM tree of your html file with phantomJS please ? |
Not really an issue, but more a question:
Can weasyprint render javascript created content? I did search the docs, but there is no mention of it.
The text was updated successfully, but these errors were encountered: