Currently I'm using ImageMagick to convert PDF's into jpegs with the aim of creating 2 jpegs on the fly, 1 a regular sized jpeg and 1 a thumbnail.
Here's where I am currently. This code below successfully creates jpegs of all the pages in the pdf ($targetFile) and renames them with the jpeg extension. Instead of saving those outputted files in the same directory I'd like to put them in an already created directory within the working directory called "thumbs".
Code: Select all
$image = exec("convert " . $targetFile . " " . substr_replace($targetFile , 'jpg', strrpos($targetFile , '.') +1));
The next step is to get it to create 2 jpegs on the fly, one large one small, saving the large ones alongside the PDF and the small in "thumbs" directory.
Can anyone help please? I'm relatively familiar with PHP and I'm pretty sure this an ImageMagick "problem" more so than PHP as it's working, just not going where I want it!
Cheers.