Page 1 of 1

Issue in fetching correct height and width after extracting from pdf

Posted: 2015-06-08T01:36:07-07:00
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.

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

Posted: 2015-06-08T02:06:41-07:00
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.