Missing several line of text when using html() with autopaging: text
See original GitHub issueI’m facing an issue when using html() function to print out a html element.
This is my code:
await doc.html(contentRef.current, {
margin: [MARGIN_TOP, 0, MARGIN_BOTTOM, 0],
autoPaging: 'text', // I think this property is the cause
y: 30, // distance metadata to header (84pt) - margin top (54pt)
html2canvas: {
scale: 1.0,
ignoreElements: element => element.id === autoTableConfig?.elementId,
},
})
/// pdf save....
This is content displaying the my DOM
When I set autoPaging = text
The output pdf will be:
As you see, we miss the text line EU PEDE MOLLIS PRETIUM. INTEGER TINCIDUNT. CRAS DAPIBUS. VIVAMUS ELEMENTUM SEMPER NISI.
Then I tried switching to slice
mode, now the text line is rendered, but it’s sliced and put on 2 different pages. This is not our expectation 😦
I’m wondering if it is a problem when calculating the possition to render the next line of Context2D when a text line is cut off. I don’t have any idea to fix it so far.
Hope to see your help soon
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:5
Top Results From Across the Web
autoPaging in jsPdf .html() method - Stack Overflow
I tried using it but didnt see anything different on the generated pdf. I am guessing it might be related to paging like...
Read more >Outlook 2013 Random Missing Lines of Text
There are miscellaneous lines of text missing from within the body of email messages. This phenomenon appears to only be present in HTML...
Read more >Convert HTML to PDF using JavaScript - CodexWorld
HTML to PDF with JavaScript - Convert HTML content to PDF using jsPDF and jQuery. ... Specify the content in text() method of...
Read more >Exporting table to multipage PDF file using kendo exportPDF
I need to export large table to pdf file using kendo pdfExport. This code I have so far: html: <div style="position:relative;" ...
Read more >APL Standard Commands (APL 1.2) | Alexa Skills Kit
This document provides a reference to the commands in APL 1.2.
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
From what have figured out, it appears to be an issue between autopagin text and margin bottom. For me, its seems to have fixed by removing setting margin-bottom 0px and removing autopaging. Although my margins were previously all set to 10.
in my case all of the formatting problems start when autopaging is set to true and i have more than 2 pages … the more pages i have the bigger are the formatting errors…