Reputation: 1182
My pdf first page looks like :
When I run below command:
exec("convert -density 300 $pdf_path $temp_images 2>&1",$output);
It converts its page in image that looks like:
this thing happen only when the dimensions of pdf are width- 595 and height- 842.
Any suggestion will be appreciated.
Upvotes: 1
Views: 236
Reputation: 1182
This code solve my problem but I want this in command line
$im = new Imagick();
$im->readImage( $pdf_path );
$im->setImageFormat( "jpg" );
$im->writeImage( $temp_images );
echo 'Image Converted';
Upvotes: 1
Reputation: 31139
Looks like the CropBox of the PDF is being used instead of the media size, or possibly ImageMagick is sending a fixed (incorrect, Letter) media size to Ghostscript in order to render the page.
Unfortunately that's about all I know regarding ImageMagick, you need someone who can tell you how to find and alter the Ghostscript invocation.
Upvotes: 1