Fixed: delete merged data
This commit is contained in:
parent
bbab104f7e
commit
287ba39dc0
|
@ -53,10 +53,11 @@ abstract class BaseCompiler implements Responsable
|
|||
*/
|
||||
public function merge(array $documents): self
|
||||
{
|
||||
$outfile = '/tmp/' . Str::uuid()->toString() . '.pdf';
|
||||
$outfile = new File('/tmp/' . Str::uuid()->toString() . '/' . Str::uuid()->toString() . '.pdf', false);
|
||||
mkdir($outfile->getPath());
|
||||
$paths = array_map(fn ($document) => static::compile($document)->getPath(), $documents);
|
||||
$command = collect([
|
||||
'pdfjam --nup 1x1 --outfile ' . $outfile,
|
||||
'pdfjam --nup 1x1 --outfile ' . $outfile->getPathname(),
|
||||
...array_map(fn ($path) => escapeshellarg($path), $paths),
|
||||
])->implode(' ');
|
||||
|
||||
|
@ -71,7 +72,7 @@ abstract class BaseCompiler implements Responsable
|
|||
throw (new CompilerException('Compilation failed.'))->setOutput($output);
|
||||
}
|
||||
|
||||
return static::fromFile($outfile);
|
||||
return static::fromFile($outfile->getPathname());
|
||||
}
|
||||
|
||||
public function storeAs(string $directory, string $name, string $disk): string
|
||||
|
|
Loading…
Reference in New Issue