only first html() call is rendered
See original GitHub issueI 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?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top Results From Across the Web
only first array element is rendering in react js - Stack Overflow
I have an array but only first array element is rendering.How to do this. This is response from Firebase. In console it is...
Read more >Run Code in React Before Render - Dave Ceddia
Want to run some code before your React component renders? There are a few ways to make this work, and we'll talk about...
Read more >Rendering Elements - React
To render a React element, first pass the DOM element to ReactDOM.createRoot() , then pass ... In practice, most React apps only call...
Read more >Rendering and Updating Data using Component Lifecycle ...
Let's look at an example of fetching data from a remote endpoint and using the same data into render() to render it into...
Read more >ASP.NET Core Razor component lifecycle | Microsoft Learn
If the component is rendering for the first time on a request: ... InvokeAsync is called, the ElementReference is only used in ...
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
I have the same issue and I think it is not related to #3204. Only first call to
html
is rendered regardless of Y offset. I will try to fix this and provide a PR if I can.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.