fix: ensure pdf annotations are preserved when sanitizing upload
This commit is contained in:
@@ -22,7 +22,9 @@ class Sanitizer
|
||||
$filesystem = new Filesystem();
|
||||
|
||||
if (true === $backup) {
|
||||
$filesystem->copy($inputFilepath, $inputFilepath.'.bak');
|
||||
$parts = pathinfo($inputFilepath);
|
||||
$backupFilename = sprintf('%s/%s.orig.%s', $parts['dirname'], $parts['filename'], $parts['extension']);
|
||||
$filesystem->copy($inputFilepath, $backupFilename);
|
||||
}
|
||||
|
||||
$tempFilename = sha1($inputFilepath);
|
||||
@@ -57,6 +59,7 @@ class Sanitizer
|
||||
'-dNOPAUSE',
|
||||
'-dQUIET',
|
||||
'-dBATCH',
|
||||
'-dPreserveAnnots=false',
|
||||
'-sDEVICE=pdfwrite',
|
||||
'-dCompatibilityLevel=1.4',
|
||||
'-sOutputFile='.$outputFilepath,
|
||||
|
||||
Reference in New Issue
Block a user