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.

Single page height / width specification

See original GitHub issue

Hello, i want to fit exactly x no of images in 1 page.

I designed an algorithm that fits the images on a single browser window, keeping intact their orignal ppi.

It works good when viewed in browser, but the pdf page has different height. Can you please provide me with the height / width of the page you generate?

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
eKoopmanscommented, May 20, 2018

Hi @devxpy, some info:

So you can specify the jsPDF page size to A4 like so:

html2pdf(element, {
    jsPDF: { format: 'a4' }
});

Note that format will also accept an array of [length, width] values like [595.28, 841.89], but those values are in points, which you would need to convert from pixels or any other unit (1 pixel = 72/96 points).

0reactions
devxpycommented, May 23, 2018

Thanks for the explanation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Most Standard Webpage Sizes in 2022 [And Ideal Ones]
The standard webpage size uses a maximum width of 1440 pixels for Desktops. This is because most desktop resolutions use a wider resolution ......
Read more >
Web Image Specifications "Cheat Sheet"
Homepage thumbnail should be 400 x 250px. Article images should have a maximum width of 510px (can be any height). The Elm ...
Read more >
size - CSS: Cascading Style Sheets - MDN Web Docs
The size CSS at-rule descriptor, used with the @page at-rule, defines the size and orientation of the box which is used to represent...
Read more >
Image Size Specifications - What is the proper size for an ...
Full-width images: At least 1400px wide for the highest quality. (Height doesn't matter.) Half-width images: At least 700px wide for the highest ...
Read more >
Web page size and layout - Iteracy Ltd
Designs which stretch to be full width in every screen size can become unreadable on very wide screens. It's best to aim for...
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