.html(), how to fit content to single pdf? My div is printing into 3 total pages?
See original GitHub issueUsing the latest version, here:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.1.1/jspdf.umd.min.js" integrity="sha512-/Am09zlYshHgRizY3RkConGj4BsYIdb8mS7r5XAXw0rTiLgGSHzpUHTQBhinWR32C/KzLr749J1xuORzT2JnRA==" crossorigin="anonymous"></script>
</script>
<script src="https://html2canvas.hertzen.com/dist/html2canvas.min.js"></script>
let pdf = new jsPDF('l', 'pt','a4',true);
pdf.html(document.getElementById('mainClone'), {
callback: function () {
pdf.save('test.pdf');
window.open(pdf.output('bloburl')); // to debug
}
});
Essentially it is printing this one element out into 3 pages (landscape). I can’t figure out how to adjust the sizing properly so everything passed into the first param of html() gets used in one page. Anyone have tips on this?
Below are the results of the html table and then the resulting pdf.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Top Results From Across the Web
html(), how to fit content to single pdf? My div is printing into 3 ...
Essentially it is printing this one element out into 3 pages (landscape). I can't figure out how to adjust the sizing properly so...
Read more >CSS Printing: Avoiding cut-in-half DIVs between pages?
The advice I can give you is, to accomplish this functionality in FF, wrap the content that you don;t want to break ever...
Read more >fit-content - CSS: Cascading Style Sheets - MDN Web Docs
The fit-content behaves as fit-content(stretch). In practice this means that the box will use the available space, but never more than ...
Read more >Designing For Print With CSS - Smashing Magazine
The rule below specifies a default page size of 5.5 by 8.5 inches. If you intend to print a book, perhaps by a...
Read more >CSS page-break-inside property - W3Schools
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, PHP, Python,...
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
Any updates?
Thanks, I’ll give it a shot!