Forum How do I...?

Fit A4 with 300 ppi to pdf

strernd
Hi,

I already published a book made with CSS and HTML, compiled by prince. I used the standard 96 ppi (or is it 72?) but now I want to make a book in higher resolution.
My page container ist 2480x3508px and is displayed fine in the browser, but when I compile the html with prince I only get about a third of the page on one pdf page.
Is there something I have to set in the CSS or some Prince Options that allow me to fit the 2480px3508px (A4@300ppi) to a single pdf page?

Is any example available?

Thank you
mikeday
You can use the --css-dpi command-line option to make px units be converted to small physical sizes.
strernd
I actually tried that before, but it did produce the same outcome.
mikeday
What command-line did you specify?
strernd
prince --css-dpi=300 in.html
mikeday
The attached HTML file has a big div with width 3480px and height 3508px.

If I run with --css-dpi=600 it is small enough to fit, but at 300 it is still too big to fit on the page due to the page margins. Disabling the margins with @page { margin: 0 } should make it fit properly.
  1. big.html0.1 kB
strernd
Thank you, this example showed my mistake. Actually it scaled, but the font was in pt so it stayed big and it looked like it wouldn't scale.