Pngs to pdf with "-page Letter" : PDF is too small

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
stuporglue
Posts: 6
Joined: 2011-10-19T20:15:50-07:00
Authentication code: 8675308

Pngs to pdf with "-page Letter" : PDF is too small

Post by stuporglue »

I'm trying to convert a bunch of png files into a single pdf. All of the pngs are all 1424x1095.

The PDF is meant to be printed on 8.5x11 inch paper (Letter sized)

The command I'm running is:

Code: Select all

convert output/* -rotate 90 -page Letter output.pdf
The resulting PDF isn't letter sized, it's too small.

Code: Select all

pdfinfo -f 1 -l 5 output.pdf 
---
Page    1 size: 370.286 x 479.193 pts
...
This page (http://www.imagemagick.org/script/comma ... s.php#page) seems to say that "-page Letter" should be 612x792 postscript points

Any idea what am I doing wrong?

Here's the output of "convert --version"

Code: Select all

Version: ImageMagick 6.8.7-1 2013-10-19 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: bzlib djvu fftw fontconfig freetype jbig jng jp2 jpeg lcms lqr openexr pango pangocairo png png tiff x xml zlib
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Pngs to pdf with "-page Letter" : PDF is too small

Post by fmw42 »

This works for me to get a pdf file that is 8.5x11. I am using IM 6.8.7.9 Q16 Mac OSX

logo: is 640x480

convert logo: -rotate 90 -page letter tmp2.pdf

Image: tmp2.pdf
Format: PDF (Portable Document Format)
Mime type: application/pdf
Class: DirectClass
Geometry: 612x792+0+0
Resolution: 72x72
Print size: 8.5x11
stuporglue
Posts: 6
Joined: 2011-10-19T20:15:50-07:00
Authentication code: 8675308

Re: Pngs to pdf with "-page Letter" : PDF is too small

Post by stuporglue »

Interesting. That works for me too, but the same command doesn't with my image. I even tried resizing it to 640x480 and the same thing still happens


Here's my page 001.png http://stuporglue.org/downloads/001.png

Code: Select all

stuporglue@speed:~/src/printbook$ convert 001.png -rotate 90 -page letter output.pdf && pdfinfo output.pdf
...
Page size:      370.286 x 479.193 pts

Code: Select all

stuporglue@speed:~/src/printbook$ convert logo: -rotate 90 -page letter tmp2.pdf && pdfinfo tmp2.pdf
...
Page size:      612 x 792 pts (letter)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Pngs to pdf with "-page Letter" : PDF is too small

Post by fmw42 »

I presume it is because png density is specified as pixelspercentimenter and not pixelsperinch. The -page probably assumes units of pixelsperinch. This may or may not be a bug when dealing with PNG. However, whether a bug or not, it would seem to me that -page needs to be enhanced to account for units.
stuporglue
Posts: 6
Joined: 2011-10-19T20:15:50-07:00
Authentication code: 8675308

Re: Pngs to pdf with "-page Letter" : PDF is too small

Post by stuporglue »

That makes sense, I was able to play with the -page parameters and get the right dimensions.

It'd be nice if it were documen...oh, there it is.

http://www.imagemagick.org/Usage/resize/

"A "-units" setting (with arguments 'PixelsPerInch' or 'PixelsPerCentimeter') may be required in some situations to get this operator to work correctly. This setting can also be important for output to Postscript and PDF image file formats."

This is the resulting command that worked:

Code: Select all

convert output/* -resize 3300x2550 -units 'PixelsPerInch' -density 300 output.pdf
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Pngs to pdf with "-page Letter" : PDF is too small

Post by fmw42 »

Yes, that is the standard, long way to do it.

You could post a bug report about -page with pngs and see what the developers say.
stuporglue
Posts: 6
Joined: 2011-10-19T20:15:50-07:00
Authentication code: 8675308

Re: Pngs to pdf with "-page Letter" : PDF is too small

Post by stuporglue »

Thanks,

I filed a bug report.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Pngs to pdf with "-page Letter" : PDF is too small

Post by fmw42 »

stuporglue wrote:Thanks,

I filed a bug report.

I do not see any bug report on this.
stuporglue
Posts: 6
Joined: 2011-10-19T20:15:50-07:00
Authentication code: 8675308

Re: Pngs to pdf with "-page Letter" : PDF is too small

Post by stuporglue »

I submitted it here: http://www.imagemagick.org/script/contact.php

Is that not the right place? I googled "imagemagick bug report" and that's what I got.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Pngs to pdf with "-page Letter" : PDF is too small

Post by fmw42 »

stuporglue wrote:I submitted it here: http://www.imagemagick.org/script/contact.php

Is that not the right place? I googled "imagemagick bug report" and that's what I got.

Typically one just uses the Bugs forum at viewforum.php?f=3. But that form is OK, too.
Post Reply