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.

`pagesplit` and dynamic width/height not producing expected results

See original GitHub issue

Are you using the latest version of jsPDF?

I have been unable to resolve it using Version 1.2.61.

Have you tried using jspdf.debug.js?

Yes, I still have been unable to get different results.

Steps to reproduce

I’ve tried several different combinations, that * do not work*:

  1. Non-working Example 1
pdf.addHTML(document.body, {
                      pagesplit: true
                    }, function(dispose) {
                        pdf.save('FieldStack-PracticeMetrics-' + new Date() + '.pdf');
                    });

Result:

FieldStack-PracticeMetrics-Thu Mar 10 2016 10-30-38 GMT-0500 (EST) 2.pdf

  1. Non-working Example 2
pdf.addHTML(document.body, {
                      pagesplit: true,
                      height: document.body.offsetHeight,
                      width: document.body.offsetWidth
                    }, function(dispose) {
                        pdf.save('FieldStack-PracticeMetrics-' + new Date() + '.pdf');
                    });

Result:

FieldStack-PracticeMetrics-Thu Mar 10 2016 10-34-38 GMT-0500 (EST).pdf

Possible Related Issues

Issue #652, Issue #645

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
eldyvooncommented, Nov 14, 2017

@joshuapowell how you calculate the scale factor?

0reactions
Uzlopakcommented, May 14, 2018

Please dont mess with the scaleFactor. Despite its name, the scaleFactor is used internally for converting the measurements and positions from the given system to px. E.g. if you initiate the jsPDF with mm, then jsPDF converts all the positions from mm to pt and image width and height from mm to pt. Or was it px?

So actually jsPDF needs an resolution setting for images and not a scaleFactor manipulation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

`pagesplit` and dynamic width/height not producing expected ...
Have you tried using jspdf.debug.js? Yes, I still have been unable to get different results. Steps to reproduce. I've tried several different ...
Read more >
jspdf get page count: ` pagesplit ` and dynamic width/height ...
Adding page numbers to footer using fromHTML · Issue #274 ... 2 Jun 2014 ... I am looking for a way to insert...
Read more >
jsPDF multi page PDF with HTML renderer - Stack Overflow
I have the same working issue. ... Automatically not split data to multi pages. ... toDataURL("image/png"); width = onePageCanvas.width; height ...
Read more >
Docuflex 11.3 - Oracle Help Center
IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ITS ... Docuflex 11.3 does not support dynamic composition of scripts that flow from...
Read more >
Advanced operation instructions
You may print no more than three copies of this manual for your own use. ... As a result, Raymarine cannot accept liability...
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