I have two cases where I get unexpected results when running .html()
I am using jspdf v2.1.1
Case1:
const myDoc = new jsPDF();
const options = {
x: 10,
y: 10,
callback: function (doc) {
let options2 = {
x: 10,
y: 20,
callback: function (doc2) {
doc2.save();
}
};
doc.html("<i>Test2</i>", options2);
}
};
myDoc.html("<b>Test1</b>", options);
What I expect here is to see 1 pdf file with two lines:
Test1
_Test2_
But what I get is only 1 line Test1, where did _Test2_ go?
Case2:
const myDoc1 = new jsPDF();
const options1 = {
x: 10,
y: 10,
callback: function (doc) {
doc.save();
}
};
myDoc1.html("<b>Test1</b>", options1);
const myDoc2 = new jsPDF();
const options2 = {
x: 10,
y: 10,
callback: function (doc) {
doc.save();
}
};
myDoc2.html("<i>Test2</i>", options2);
What I expect here is to see 2 pdf files, one with Test1 and second with _Test2_. But instead I get one empty file and another file with Test1.
Can someone confirm if they get same behaviour? What is going on?
That's interesting. Seems like multiple consecutive calls to the html function are broken.
Hi @HackbrettXXX. I can see you are an active contributor to the repo. Any estimate on how long it would take to fix and release new version? Thanks
I'm currently quite busy, so if I have to implement the fix myself it will probably take weeks if not months. If you or someone else provides a pull request, I will merge and release it in a timely manner.
This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.
This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.