-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Html function not working in Node.js environment #2970
Comments
Yes. Html2canvas requires a working DOM implementation. See also #2805 (comment) and following comments. |
@HackbrettXXX Thank you for response. That example does not work tho, the call back is not called and the document generated after calling the html function is not changed. |
What I meant to say is: the html function can't work in a node environment, because it requires a complete DOM implementation. The |
@HackbrettXXX Thank you for the clarification and your time! |
I am trying to render a html data into PDF which is generated on server side. Adding image or just text work well, but html function seems to not do anything. The callback is not even run as I dont get a console log output from it.
Below is my code. Thank you for any help suggestions if I am doing anything wrong. I know this is library primarly to be used on frontend, but I found that since version 2 it should work on backend as well.
`
const doc = new jsPDF('p', 'cm', [29.7, 21]);
And my paykage.json:
"btoa": "^1.2.1", "canvas": "^2.6.1", "dompurify": "^2.0.12", "exceljs": "^4.1.1", "html2canvas": "^1.0.0-rc.5", "jspdf": "^2.1.1",
The text was updated successfully, but these errors were encountered: