mirror of
https://github.com/24eme/signaturepdf.git
synced 2023-08-25 09:33:08 +02:00
Using php function to move and copy instead of shell
This commit is contained in:
parent
5b6d30a870
commit
0e891e1307
7
app.php
7
app.php
@ -205,10 +205,11 @@ $f3->route('GET /signature/@hash/pdf',
|
|||||||
if (!$layers) {
|
if (!$layers) {
|
||||||
Web::instance()->send($originalFile, null, 0, TRUE, $filename);
|
Web::instance()->send($originalFile, null, 0, TRUE, $filename);
|
||||||
}
|
}
|
||||||
|
copy($originalFile, $finalFile);
|
||||||
$bufferFile = str_replace('.pdf', '_tmp.pdf', $originalFile);
|
$bufferFile = str_replace('.pdf', '_tmp.pdf', $originalFile);
|
||||||
shell_exec(sprintf("cp %s %s", $originalFile, $finalFile));
|
foreach($layers as $layerFile) {
|
||||||
foreach($layers as $layer) {
|
shell_exec(sprintf("pdftk %s multistamp %s output %s", $finalFile, $layerFile, $bufferFile));
|
||||||
shell_exec(sprintf("pdftk %1\$s multistamp %2\$s output %3\$s && mv %3\$s %1\$s", $finalFile, $layer, $bufferFile));
|
rename($bufferFile, $finalFile);
|
||||||
}
|
}
|
||||||
Web::instance()->send($finalFile, null, 0, TRUE, $filename);
|
Web::instance()->send($finalFile, null, 0, TRUE, $filename);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user