Issue in fetching correct height and width after extracting from pdf

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
pooja
Posts: 1
Joined: 2015-06-08T01:20:23-07:00
Authentication code: 6789

Issue in fetching correct height and width after extracting from pdf

Post by pooja »

Hi,

I am using below code to extract image from pdf :-

Code: Select all

$imagick = new Imagick();
$imagick->readImage('D:\DBCL\1.pdf');
$imagick->writeImage('D:\DBCL\output.jpg');
Which is working fine and image saved in jpg format.
But when I try to fetch width and height of saved image its not give me the original height and width which I have given in pdf.

Issue is pdf will be uploaded by end user so I am not able to give resolution in above code.

So please help me to save image from pdf in the original resolution, height and width.

Any help will be appreciated.

Thanks in Advance.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Issue in fetching correct height and width after extracting from pdf

Post by snibgo »

IM doesn't extract images from PDF files. Instead, it makes a raster image from each page.

If you want to extract images from PDFs, I think "pdfimages" is a better tool.
snibgo's IM pages: im.snibgo.com
Post Reply