I'm trying to a create a PDF of 300dpi, but always end up with 72x72.
convert -verbose -density 300 source.png output.pdf
The source PNG is 300dpi, but the output PDF is always 72x72. Is this correct? The print size is massively inflated. I've also tried,
convert -verbose source.png -density 300 output.pdf
Here's the identify outputs for both files,
Image: source.png
Format: PNG (Portable Network Graphics)
Class: DirectClass
Geometry: 3911x2775+0+0
Resolution: 300x300
Print size: 13.0367x9.25
Image: output.pdf
Format: PDF (Portable Document Format)
Class: DirectClass
Geometry: 3911x2775+0+0
Resolution: 72x72
Print size: 54.3194x38.5417
I'm using ImageMagick 6.4.5
Thanks
300dpi PDFs?
Re: 300dpi PDFs?
Try opening this file in any PDf viewer and check for properties to see actual print size. If print size is 13.0367 inchx9.25 inch your PDF is fine. It's the identify output which seems wrong. In foxit reader, size is displayed in bottom status bar. File->properties would tell you the actual size as well.Scarfy wrote: Image: output.pdf
Format: PDF (Portable Document Format)
Class: DirectClass
Geometry: 3911x2775+0+0
Resolution: 72x72
Print size: 54.3194x38.5417
Thanks
But, I think it's 'convert' which is not converting jpg to pdf properly. Try to save jpg in pdf using some other program like photoshop and then run identify again. You should definitely get 13.0367 inchx9.25 inch size in that case.
I'm having the same problem but in reverse direction. See following topic.
viewtopic.php?f=1&t=14922
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: 300dpi PDFs?
PDF's by default do not have a 'resolution'. That is the nature of the format.
As such 72x72 is just the default resolution of IM and nothing to do with the file
which has no resolution (or density).
As such 300dpi PDF's is a misnomer.
However inside the PDf a raster image may be present which has a 'preferred' resolution. Getting that resolution has proven pretty much impossible to get!
As such 72x72 is just the default resolution of IM and nothing to do with the file
which has no resolution (or density).
As such 300dpi PDF's is a misnomer.
However inside the PDf a raster image may be present which has a 'preferred' resolution. Getting that resolution has proven pretty much impossible to get!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: 300dpi PDFs?
Ah, thanks guys.
I checked in a PDF viewer and it said the PDF's page size is 331.258 x 234.95 mm.
The magic of Google Calculator helped to prove that it is in fact 13.04" x 9.25". Importing the PDF into GIMP reported likewise.
So, yeah, the identify is off. No worries
I checked in a PDF viewer and it said the PDF's page size is 331.258 x 234.95 mm.
The magic of Google Calculator helped to prove that it is in fact 13.04" x 9.25". Importing the PDF into GIMP reported likewise.
So, yeah, the identify is off. No worries
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: 300dpi PDFs?
That is a real world 'page size' for which the PDF was formatted for. This is completely different to the 'resolution' or number of pixels per inch on that page!Scarfy wrote:I checked in a PDF viewer and it said the PDF's page size is 331.258 x 234.95 mm.
A printer could be printing that page at 300, 600, or 1200 dots per inch (dpi) and on a screen it can be anything from about 72 dpi to 120 dpi depending on the quality of the display, particularly the LCD displays of today.
This is what PDF's were designed for -- any resolution of display or printer.
Of course internally raster images have a 'prefered resolution' so a low-quality PDF whcih displays photos well on the screen may not display them as good on a 'photo quality' printer!
A PDF containing a high resolution raster image or photo however will automatically scale/resize the image for the display/print resolution and so so well, but at a major cost of file size.
Only raster images are effected by this. Text, and SVG, WMF, lines drawing are vector based objects, and will display well and ALL resolutions.
So if you want a high quality PDF, avoid raster image (and ImageMagick), but if you must insert a raster, use the highest resolution you can for the file size and 'copyright' considerations. ImageMagick can help in raster preparation, but it is not designed for direct PDF generation.
As for extracting raster image 'perfectly' well I'm still looking for a good solution that does not involve trial and error! Best idea so far is extra the image at a very high resolution, and looking at it try to determine the 'ideal number of pixels' in an image and resize it accordantly. This is not however a 'perfect' extraction.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/