Callback Function Not Called - addHTML & fromHTML
See original GitHub issueThank you for submitting an issue to jsPDF. Please read carefully.
jsPDF Version 1.3.5
Have you tried using jspdf.debug.js? Yes, currently using it.
Steps to reproduce
var doc = new jsPDF();
doc.fromHTML(document.getElementById("chip"), function(){
console.log("Callback");
doc.save('test.pdf');
})
If I use addHTML
instead, I get the same issue. I see the canvas
object being rendered
0ms html2canvas: html2canvas 1.0.0-alpha.10
189ms html2canvas: Canvas renderer initialized (1746x32 at 174,437) with scale 1
But the callback function is still not called.
http://jsbin.com/qamececego/edit?html,js,output
What I saw Callback function is not called. Console.log not executed and pdf not saved.
What I expected Callback function to be called.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:8
Top Results From Across the Web
Callback Function Not Called - addHTML & fromHTML #1693
Callback function is not called. Console.log not executed and pdf not saved. What I expected. Callback function to be called.
Read more >Callback Function Not Called - addHTML & fromHTML
Have you tried using jspdf.debug.js? Yes, currently using it. ... But the callback function is still not called. ... Callback function is not...
Read more >JSPDF html() Method callback not Fired - PCF - Stack Overflow
jsPDF callback never gets fired because it depends on core-js to handle Promise. If you import 'core-js/features/promise' callback is called ...
Read more >html2canvas, jspdf warning
The callback function is called when fromHTML in jsPDF loaded all images and generated the document. var doc = new jsPDF('p', 'pt', 'a4',...
Read more >.load() | jQuery API Documentation
A callback function that is executed when the request completes. ... When calling .load() using a URL without a suffixed selector expression, the...
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
you are calling it completely wrong.
but they are also missing documentation.
fromHTML( element.innerHTML, xAxis, yAxis, { options and settings (which I dont know)}, callback HERE! )
so it would be your 5th parameter you are trying to call it on the second… probably getting an error.
GL
It seems the addHTML function is deprecated. Here is another way to create PDF file.
I can get rendered pdf file with above code, but there are still some small style issues yet. So finally I removed jsPDF library, however I will check if this library will be improved later as well.