How to convert pdf files that contain spaces in their filenames using the exec() function.
For e.g: file 1.pdf to file 1.jpg
<?php
$pdf = "file 1.pdf";
$pdf_first_page = "file 1.pdf[0]";
$jpg = str_replace("pdf", "jpg", $pdf);
exec ("convert $pdf_first_page $jpg");
?>
I'm getting the following errors:
convert.exe: unable to open image `file 1.pdf': No such file or directory @ error/blob.c/OpenBlob/2702.
convert.exe: no images defined `file 1.jpg' @ error/convert.c/ConvertImageCommand/3257.