PDF creation pixel sizes causes layout to change
See original GitHub issueHi,
When creating PDFs from a responsive web page, lets say the page has a css rule to show a narrower version below 1024
pixels screen width and we supply width: "1024px"
to pdf
function. The rule should not apply on this case however it does and the layout changes in generated pdf.
Only when the width parameter is 4/3 of the actual width of viewport, then the pdf has exact same layout of given viewport width. This seems to be something related to an inches / points confusion somewhere (96 pixels per inch, 72 pixels per point. 96/72 = 4/3)
So, when I provide 1365px
as pdf width I get the exact representation of the page at 1024px
viewport width. Anything below 1365px
, page acts like the viewport is below 1024px
and applies the appropriate responsive css rules.
I’m not sure if this is an upstream bug or something else though. Margins are set to 0 btw.
Any ideas?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:19
- Comments:20 (2 by maintainers)
@jbprat really curious about this too
What is
req.body.evidenceWidth
,req.body.evidenceHeight
andrealPageHeight
, supposed to be?