Hi,

I have a HTML document with 2 pages, each with a width and height of 210mm*297mm, which is the size of an A4 page.

HTML:

<page>Page 1</page>

<page>Page 2</page>

CSS:

page { width: 210mm; height: 297mm; }

However, when I convert the page to PDF, the size doesn’t hold up.

r/webdev - HTML document size doesn't match with PDF document size

The PDF is A4, and has dimensions of 210mm*297mm just like the HTML page, but the HTML pages are still too short for the PDF pages.

r/webdev - HTML document size doesn't match with PDF document size

Does anyone have an idea why this is happening? A solution is to increase the size of the HTML page to fit correctly inside the PDF page, but I’m curious as to why the dimensions are the same but the output doesn’t reflect that.

Thanks



Source link

Write A Comment