question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Only one page is created with html2pdf

See original GitHub issue

I have a long and wide html page. I would like to print it to pdf with the CSS I’ve applied. I tried your html2pdf function and notice the following:

1: only one page is created and cut the top left corner of my page. 2: Font is slightly different than the original page.

Any clue on how to show multiple pages and how to make the webpage fit into one page wide?

Thank you for submitting an issue to jsPDF. Please read carefully.

Are you using the latest version of jsPDF? Yes Have you tried using jspdf.debug.js? Nope Steps to reproduce Pass a wide/long page or dom to html2pdf

Ideally a link too. Try fork this http://jsbin.com/rilace/edit?html,js,output

What I saw Only one page is created and only shows top-left part of the page.

What I expected Showing multiple pages and be able to fit into page width or set page width.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:6

github_iconTop GitHub Comments

2reactions
Uzlopakcommented, Oct 30, 2017

this html2pdf seems to be unsupported code. So you should look for alternatives and should not hope for any support/bugfixing.

0reactions
Uzlopakcommented, Sep 7, 2018

We are working on a new html2pdf plugin, which will be based on html2canvas and our context2d plugin (like the solution of html2pdf). This should lead to more reliable results for your projects. And it will give us the time to focus on the core functionality of pdf-generation because we will not use our energy for writing/supporting/extending 2 html plugins. If you still want to use addHTML or fromHTML you can still use jsPDF 1.4.1.

Best Regards

Read more comments on GitHub >

github_iconTop Results From Across the Web

Total HTML in one PDF page · Issue #37 - GitHub
Now I need to create only one PDF page with the HTML (If HTML is more, then it should automatically resize or reduce...
Read more >
Limit the generate pdf to one page only? html2pdf library
I'm trying to limit the pdf to one page only, is there a way that I can put limit ...
Read more >
html2pdf.js | Client-side HTML-to-PDF rendering using pure JS.
html2pdf.js has the ability to automatically add page-breaks to clean up your document. Page-breaks can be added by CSS styles, set on individual...
Read more >
How to create reports using HTML2PDF
This article guides you on how to create reports using the HTML2PDF component. Get it here. Also, before you continue reading this article ......
Read more >
How to Generate a PDF with JavaScript | PSPDFKit
In this post, we'll take a look at two popular JavaScript libraries for converting HTML pages to PDFs. First, we'll look at html2pdf...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found