Why PDF read into imagick always small resolution.

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
JohnSmith
Posts: 11
Joined: 2012-10-01T16:41:10-07:00
Authentication code: 67789

Why PDF read into imagick always small resolution.

Post by JohnSmith »

I kind of hate how imagick works with psf's at this point. When i $im->readImage($pdf_file_path); size is about 600x400px why its so small?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Why PDF read into imagick always small resolution.

Post by fmw42 »

unless there is a raster imbedded in the pdf, pdf files are basically vector and thus have no size. They need to be told what size to use to convert to some other raster format. The is done via the -density parameter.

see
http://www.imagemagick.org/Usage/formats/#vector
JohnSmith
Posts: 11
Joined: 2012-10-01T16:41:10-07:00
Authentication code: 67789

Re: Why PDF read into imagick always small resolution.

Post by JohnSmith »

Would be great if it could be same size as when you open pdf in adobe reader and set zoom to 100%...

By the way i use imagick for php i dont want to run shell commands for security reasons.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Why PDF read into imagick always small resolution.

Post by fmw42 »

JohnSmith wrote:Would be great if it could be same size as when you open pdf in adobe reader and set zoom to 100%...

By the way i use imagick for php i dont want to run shell commands for security reasons.

Each viewer may set its own default density, so they all do not necessarily display the same size for 100%.

You can try setting -density 72 or -density 96 as the two most likely densities.
Post Reply