我当时在进行一个简单的PHP项目,需要将所有用户图像文件转换为PDF文件,并且需要一个简单的解决方案来转换图像
foreach ($result as $information) {
$count++;
$file = $information->{'patient_prescription'};
*Image Convert To PDF*
$success = $img->writeImage('image/patient_prescription_picture/pdf/' . $count . 'pdf');
$fileArray[$count] = 'image/patient_prescription_picture/pdf/' . $count . 'pdf';
}
答案 0 :(得分:1)
您可以尝试
foreach ($result as $information) {
$count++;
$file = $information->{'patient_prescription'};
$img = new Imagick($file);
$img->setImageFormat('pdf');
$success = $img->writeImage('image/patient_prescription_picture/pdf/' . $count . 'pdf');
$fileArray[$count] = 'image/patient_prescription_picture/pdf/' . $count . 'pdf';
}