config for convert and pdftk

This commit is contained in:
Tobias Herre 2021-11-23 13:49:17 +01:00
parent db5991c0de
commit c535d2a060
3 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,6 @@
<?php <?php
$CONVERT_CMD = "/usr/local/bin/pdftk"; $CONVERT_CMD = "/usr/local/bin/convert";
$PDFTK_CMD = "/usr/local/bin/pdftk";
$mailHost = 'mailserver.example.com'; // Specify main and backup server $mailHost = 'mailserver.example.com'; // Specify main and backup server
$mailPort = 587; // Set the SMTP port $mailPort = 587; // Set the SMTP port

View File

@ -388,7 +388,7 @@ foreach ($_POST['desc'] as $key => $val) {
$resultnam = tempnam("/tmp","karesult"); $resultnam = tempnam("/tmp","karesult");
$cmd = "$CONVERT_CMD"; $cmd = "$PDFTK_CMD";
foreach ($pdfs as $filename){ foreach ($pdfs as $filename){
$cmd .= " $filename"; $cmd .= " $filename";
} }

View File

@ -47,7 +47,7 @@ foreach ($_FILES as $key=>$files){
file_put_contents("/tmp/log.txt", "file-$key-$i\n", FILE_APPEND | LOCK_EX); file_put_contents("/tmp/log.txt", "file-$key-$i\n", FILE_APPEND | LOCK_EX);
file_put_contents("/tmp/log.txt", $files['name'][$i], FILE_APPEND | LOCK_EX); file_put_contents("/tmp/log.txt", $files['name'][$i], FILE_APPEND | LOCK_EX);
$tmpfname = tempnam("/tmp", "FOO"); $tmpfname = tempnam("/tmp", "FOO");
$cmd = "/usr/local/bin/convert $tmpname PDF:$tmpfname"; $cmd = "$CONVERT_CMD $tmpname PDF:$tmpfname";
exec ($cmd); exec ($cmd);
file_put_contents("/tmp/log.txt", "\n$cmd\n"); file_put_contents("/tmp/log.txt", "\n$cmd\n");