fix: ensure pdf annotations are preserved when sanitizing upload
This commit is contained in:
@@ -22,7 +22,9 @@ class Sanitizer
|
|||||||
$filesystem = new Filesystem();
|
$filesystem = new Filesystem();
|
||||||
|
|
||||||
if (true === $backup) {
|
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);
|
$tempFilename = sha1($inputFilepath);
|
||||||
@@ -57,6 +59,7 @@ class Sanitizer
|
|||||||
'-dNOPAUSE',
|
'-dNOPAUSE',
|
||||||
'-dQUIET',
|
'-dQUIET',
|
||||||
'-dBATCH',
|
'-dBATCH',
|
||||||
|
'-dPreserveAnnots=false',
|
||||||
'-sDEVICE=pdfwrite',
|
'-sDEVICE=pdfwrite',
|
||||||
'-dCompatibilityLevel=1.4',
|
'-dCompatibilityLevel=1.4',
|
||||||
'-sOutputFile='.$outputFilepath,
|
'-sOutputFile='.$outputFilepath,
|
||||||
|
|||||||
Reference in New Issue
Block a user