I have a set of 10 jpegs.
I need to generate 1 SINGLE PDF of these 10 images using PDF. (1 page = 1 jpeg)
Final result must be a PDF.
Can imagemagick php extension help me with that ?
I have a set of 10 jpegs.
I need to generate 1 SINGLE PDF of these 10 images using PDF. (1 page = 1 jpeg)
Final result must be a PDF.
Can imagemagick php extension help me with that ?
Yes, it can. Sample code:
<?php
$files = array(realpath('t1.jpg'), realpath('t2.jpg'));
$image = new Imagick($files);
$image->setImageFormat('pdf');
$image->writeImages(__DIR__ . '/file.pdf', true);
The second parameter of Imagick::writeImages()
controls if the resulting output is joined into one file.
Footnote: At least on windows, Imagick needs to be used with absolute paths.