Been doing a fair bit of digging this morning, and not seeing an obvious answer - is it possible to save an image to pdf format using PHP (or one of it's many libraries)?
I am fairly familiar with GD, although it doesn't seem to have a built in PDF format exporter/save function from my reading so far.
If anyone has any suggestions, it would be much appreciated!!
I tried to add this to the accepted answer. Here is an example of how to convert an image to a different format (including pdf) with the Imagick module:
$img = new Imagick('path/to/image.jpg');
$img->setImageFormat('pdf');
$success = $img->writeImage('path/to/image.pdf');
OR
$img = new Imagick();
$img->readImageBlob($imageBytes);
$img->setImageFormat('pdf');
$success = $img->writeImage('path/to/image.pdf');
I see 2 other options :
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With