PDF to image resolution question

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
armagan

PDF to image resolution question

Post by armagan »

I have three different pdf files and I convert them to gif images with the same setting. All of the images have different resolutions. Why are the resolution of the each pdf image is different? How is the image resolution determined?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: PDF to image resolution question

Post by anthony »

PDF itself should not have a default resolution. However raster images contained within the PDF may have a specific or best resolution.

In what way are your results different?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
armagan

Re: PDF to image resolution question

Post by armagan »

anthony wrote:PDF itself should not have a default resolution. However raster images contained within the PDF may have a specific or best resolution.

In what way are your results different?
3 different pdf files created with 3 different pdf creater software. The files contain mostly text, small amount of images. After conversion every gif image has different resolution. Is this because every creator has different resolution setting? Do you specify resolution when you create a pdf? Does Imagemagick/Ghostscript use this resolution for conversion?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: PDF to image resolution question

Post by anthony »

Try adding -density 72 or -density 300 before reading the PDF file, and see what happens.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
armagan

Re: PDF to image resolution question

Post by armagan »

I was already using -density 200 when I convert but I tried again with 72 and 300.

PDF 1: Creator: PScript5.dll Version 5.2.2 Producer: Acrobat Distiller 7.0.5
PDF 2: Creator: Word 2007 Save As PDF addon
PDF 3: Creator: PScript5.dll Version 5.2 Producer: GPL Ghostscript 8.15 (Created with pdf995 software)
PDF 4: Creator: QuarkXPress Passportª 4.04: LaserWriter 8 TU1-8.7.1 Producer: Acrobat Distiller 5.0.5 for Macintosh

density 72
pdf 1: 595x842
pdf 2: 595x842
pdf 3: 612x792
pdf 4: 561x788

density 300
pdf 1: 2480x3508
pdf 2: 2480x3508
pdf 3: 2550x3300
pdf 4: 2338x3283

I'd really like to know why they're having different resolutions. Any idea is appreciated.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: PDF to image resolution question

Post by anthony »

What you are listing isn't resolution, but the number of pixels.

Resolution equates pixels to real world units. Looks like a A4 sheet of paper, for the first two, US letter for the third, and a size appropriate for printing on both for the last.

PDF files are not set to a specific resolution which is why you need to specify what the resolution of the output device you are outputing. Generally 72 to 120 dpi (dots per inch) for displays 300 to 1200 for printers and 2400 dpi for photo quality printers.

IM defaults to a 72 dpi standard for displays.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply