I have written code for converting pdf to jpeg and its working fine but what option should I pass to create thumbnail in the exec();(for width and height purpose). here I am getting. I have tried -dDEVICEWIDTHPOINTS=100 -dDEVICEHEIGHTPOINTS=200 option but it seems invalid arguments.
following is my code:
//include 'thumbcreator.php';
ini_set('display_errors', 1);
$pdf='example.pdf';
$quality=90;
$res='300x300';
$exportName="pdf_export_" . time();
$exportPath=realpath(dirname(__FILE__))."/$exportName/fullres/%03d.jpg";
$exportPaththumb=realpath(dirname(__FILE__))."/$exportName/fullresthumb/%03d.jpg";
mkdir(realpath(dirname(__FILE__))."/$exportName");
mkdir(realpath(dirname(__FILE__))."/$exportName/fullres");
mkdir(realpath(dirname(__FILE__))."/$exportName/fullresthumb");
set_time_limit(900);
exec("'gs' '-dNOPAUSE' '-sDEVICE=jpeg' '-dUseCIEColor' '-dTextAlphaBits=4' '-dGraphicsAlphaBits=4' '-o$exportPath' '-r$res' '-dJPEGQ=$quality' '$pdf'",$output);
exec("'gs' '-dNOPAUSE' '-sDEVICE=jpeg' '-dUseCIEColor' '-dTextAlphaBits=4' '-dGraphicsAlphaBits=4','-dDEVICEWIDTHPOINTS=100 -dDEVICEHEIGHTPOINTS=200' '-o$exportPaththumb' '-r$res' '-dJPEGQ=$quality' '$pdf'",$output);
for($i=0;$i<count($output);$i++){
echo($output[$i] .'<br/>');
}
Any help will be appreciated. Thanks in advance :).