Error when converting HTML string to PDF
See original GitHub issueI’m trying to generate a PDF from a simple HTML string:
doc.html('<html>Hello <b>world</b></html>', {
callback: function (doc) {
doc.save();
},
x: 10,
y: 10
});
But I got the following error:
Uncaught (in promise) TypeError: Failed to execute 'createNodeIterator' on 'Document': parameter 1 is not of type 'Node'.
I’m using following libraries:
- jspdf 2.3.1
- html2canvas 0.4.1
- dompurify 2.3.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:8
Top Results From Across the Web
Solving formatting issues when converting HTML to PDF
To solve this problem roll back to Internet Explorer 8 or, if you have control over the content of the web page, skip...
Read more >Problem with conversion from html to pdf | WPF Forums
We have created a sample and convert the HTML string to a PDF document, it generates a PDF document without any exception. We...
Read more >Authentication fail error on convert Html to Pdf - Stack Overflow
It sounds like you just need to authenticate the request being made by the PDF library. For example, if it's using Basic HTTP...
Read more >Error converting HTML to PDF · Issue #4415 - GitHub
Hi, I am trying to convert html to pdf using wkhtmltopdf, below is the HTML code.
Read more >Convert HTML string to PDF file in C# and VB.NET - SautinSoft
Get HTML content from file htmlString = ReadFromFile(htmlPath); // 2. Converting HTML to PDF ... WriteLine("An error occurred during converting HTML to PDF!...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Unfortunately I didn’t. There seems to be some compatibility issues with the Salesforce framework (which I was using).
I didn’t…
It doesn’t seem possible to use this functionality on Salesforce, according to this recent post: https://salesforcecodex.com/salesforce/generate-pdf-using-jspdf-in-lightning-web-component/amp/