angezeigt wird
Code: Select all
$document = new \PhpOffice\PhpWord1\TemplateProcessor($docx_temp_file_path);
$imagePath = '/abc.png';
if (file_exists($imagePath)) {
$document->setImageValue($key, $imagePath);
}
Code: Select all
public function docxToPdf( $docx_file_path, $pdf_file_path )
{
$pythonPath = '/usr/bin/python';
$unoconvPath = '/usr/bin/unoconv';
$command = sprintf(
'"%s" "%s" -f pdf "%s" 2>&1',
$pythonPath,
$unoconvPath,
$docx_file_path
);
exec($command, $output, $return);
//
if (is_array($output) && !empty($output[0])) {
throw new Exception(json_encode(implode('; ', $output), true));
}
return true;
}