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.

Setting a custom paper size yields a blank page

See original GitHub issue

How to reproduce:

Go to the demo page and do this (http://raw.githack.com/MrRio/jsPDF/master/):

// Don't forget, that there are CORS-Restrictions. So if you want to run it without a Server in your Browser you need to transform the image to a dataURL
// Use http://dataurl.net/#dataurlmaker
var doc = new jsPDF({
  orientation: 'p',
  unit: 'px',
  format: [16, 9.5]
})

doc.setFontSize(40);
doc.text("Octonyan loves jsPDF", 35, 25);
doc.addImage('examples/images/Octonyan.jpg', 'JPEG', 15, 40, 180, 180);

When you set a custom page size, it bugs out and does not work correctly and the page is very very tiny. Even if you bump up the values significantly so you can see the page, no text is rendered and the page is blank.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
SmythConorcommented, May 14, 2019

I’d suggest building your own copy of jspdf to use in the meantime, it’s a simple build!

2reactions
Uzlopakcommented, May 15, 2019

It is fixed and new build should be released

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting a custom paper size yields a blank page #2452 - GitHub
How to reproduce: Go to the demo page and do this (http://raw.githack.com/MrRio/jsPDF/master/): // Don't forget, that there are ...
Read more >
Custom Paper size not Printing - Microsoft Community
Custom Paper size not Printing ... it will print on letter sized paper but only feed thru blank pages of my custom size,...
Read more >
Set paper size, page orientation, and margins in Pages
Click the Paper Size pop-up menu, then choose Manage Custom Sizes. Click the Add button . Double-click the new untitled name in the...
Read more >
Printing from photo tray produces blank page - HP Community
From the Home screen, touch Copy. Touch (Settings) and change the paper size, paper type, and select photo tray. Touch (Back) to return...
Read more >
How To Print Cardstock | Tips To Print Custom Card Sizes
1. Is Your Document Size the same as Your Paper Size? · Click File > Page Setup · Click dropdown to the right...
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