Browse Source

config for convert and pdftk

master
Tobias Herre 3 years ago
parent
commit
c535d2a060
3 changed files with 4 additions and 3 deletions
  1. +2
    -1
      config.sample.php
  2. +1
    -1
      submit.php
  3. +1
    -1
      upload.php

+ 2
- 1
config.sample.php 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

+ 1
- 1
submit.php 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";
} }

+ 1
- 1
upload.php 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");

Loading…
Cancel
Save