2012.04.11 09:48 "[Tiff] tiff2pdf fit image to page - how does it scale?", by David E. Meier

2012.04.11 12:20 "Re: [Tiff] tiff2pdf fit image to page - how does it scale?", by David E. Meier

Am Mittwoch, den 11.04.2012, 11:48 +0200 schrieb David E. Meier:

If I calculate the size of an A4 page with 1728 pixels width it would give me 2444 pixels in height, thus, larger than the image that is getting cropped.

Can anyone shine a little light on this matter? Thanks,

Looking into pdf2tiff.c I see a function tiff2pdf_match_papersize and its static list entry for A4 is width:595 x height:842. For 1728 pixels width this would result in a (scaled up) default of 2445 pixels.

Specifying -p sets an internal flag "pdf_overridepagesize" which later on results in the pdf_pagewidth and pdf_pageheight values, i.e. the ones written into the PDF, to be plain copies of the defaulted page width and height. If you want the actual TIFF width and height in the PDF, I guess you could just specify the DPI and leave the paper size alone?

Thank you Jürgen. I followed your suggestion and am omitting the -p flag now. This produces PDFs with everything on the page but they are not A4 anymore which leaves the scaling to the printer driver...

I also realized tiff2pdf "stretches" the pages according to the vertical resolution which does not need to be the same as the horizontal value.

However, I think this is an unexpected behavior of tiff2pdf. In my opinion it should scale instead of crop the image to the page size if specified - or provide an additional flag to do so.

David.