Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

best width of HTML/PDF document for printing

Tags:

html

printing

pdf

I'm creating HTML documents for printing, by testing I found that width of around 650px is close to the margin. It's also good for PDF documents since I need to convert the HTML to PDF if the client wishes to.

Can you tell me what is the suggested width in px for a print HTML document, that afterwards needs to be converted to PDF? I know these are relative to the DPI and stuff like that, but there should be a simpler guide to this .... e.g. most of the sites that can offer printing of certain pages, have a fixed width of around 600px for the content.

Thanks

like image 243
Ilian Andreev Avatar asked Dec 12 '10 18:12

Ilian Andreev


2 Answers

Pixels and Dots-Per-Inch are different beasts entirely, there is no simple way to translate from one to another. Obviously, then, I suggest not trying to do so.

Instead, I'd suggest using a print style-sheet and defining widths and sizes in relevant terminology for the medium, such as pt (point), pc (picas), cm, mm or in (centimetres, millimetres or inches)...

like image 58
David Thomas Avatar answered Sep 29 '22 02:09

David Thomas


Printing is generally specified in mm rather than pixels. I would suggest calculating to the paper size you're targeting.

See: http://www.unitconversion.org/unit_converter/typography.html

like image 37
Mark Redman Avatar answered Sep 29 '22 00:09

Mark Redman