This commit is contained in:
John Whitington 2019-08-18 11:25:55 +01:00
parent e6b3cc8a65
commit a18d268919
1 changed files with 8 additions and 9 deletions

View File

@ -663,26 +663,25 @@ let banned banlist = function
| SetPageMode _ | HideToolbar _ | HideMenubar _ | HideWindowUI _ | SetPageMode _ | HideToolbar _ | HideMenubar _ | HideWindowUI _
| FitWindow _ | CenterWindow _ | DisplayDocTitle _ | FitWindow _ | CenterWindow _ | DisplayDocTitle _
| RemoveId | OpenAtPageFit _ | OpenAtPage _ | SetPageLayout _ | RemoveId | OpenAtPageFit _ | OpenAtPage _ | SetPageLayout _
| ShowBoxes | TrimMarks -> false (* Always allowed *) | ShowBoxes | TrimMarks | CreateMetadata | SetMetadataDate _ | SetVersion _
| SetAuthor _|SetTitle _|SetSubject _|SetKeywords _|SetCreate _
| SetModify _|SetCreator _|SetProducer _|RemoveDictEntry _ | SetMetadata _
| ExtractText | ExtractImages | ExtractFontFile
| AddPageLabels | RemovePageLabels
-> false (* Always allowed *)
(* Combine pages is not allowed because we would not know where to get the (* Combine pages is not allowed because we would not know where to get the
-recrypt from -- the first or second file? *) -recrypt from -- the first or second file? *)
| ExtractText | ExtractImages | ExtractFontFile
| Decrypt | Encrypt | CombinePages _ -> true (* Never allowed *) | Decrypt | Encrypt | CombinePages _ -> true (* Never allowed *)
(* ISO says Noextract no longer relevent, due to accessibility concerns *)
(*| ExtractText | ExtractImages | ExtractFontFile -> mem Pdfcrypt.NoExtract banlist*)
| AddBookmarks _ | PadBefore | PadAfter | PadEvery _ | PadMultiple _ | PadMultipleBefore _ | AddBookmarks _ | PadBefore | PadAfter | PadEvery _ | PadMultiple _ | PadMultipleBefore _
| Merge | Split | SplitOnBookmarks _ | RotateContents _ | Rotate _ | Merge | Split | SplitOnBookmarks _ | RotateContents _ | Rotate _
| Rotateby _ | Upright | VFlip | HFlip | AddPageLabels | RemovePageLabels -> | Rotateby _ | Upright | VFlip | HFlip ->
mem Pdfcrypt.NoAssemble banlist mem Pdfcrypt.NoAssemble banlist
| CSP1|CSP3|TwoUp|TwoUpStack|RemoveBookmarks|AddRectangle|RemoveText| | CSP1|CSP3|TwoUp|TwoUpStack|RemoveBookmarks|AddRectangle|RemoveText|
Draft|Shift|Scale|ScaleToFit|RemoveAttachedFiles| Draft|Shift|Scale|ScaleToFit|RemoveAttachedFiles|
RemoveAnnotations|RemoveFonts|Crop|RemoveCrop|Trim|RemoveTrim|Bleed|RemoveBleed|Art|RemoveArt| RemoveAnnotations|RemoveFonts|Crop|RemoveCrop|Trim|RemoveTrim|Bleed|RemoveBleed|Art|RemoveArt|
CopyCropBoxToMediaBox|CopyBox|MediaBox|HardBox _|SetTrapped|SetUntrapped|Presentation| CopyCropBoxToMediaBox|CopyBox|MediaBox|HardBox _|SetTrapped|SetUntrapped|Presentation|
BlackText|BlackLines|BlackFills|CopyFont _|CSP2 _|StampOn _|StampUnder _| BlackText|BlackLines|BlackFills|CopyFont _|CSP2 _|StampOn _|StampUnder _|
AddText _|ScaleContents _|AttachFile _|CopyAnnotations _|SetMetadata _| AddText _|ScaleContents _|AttachFile _|CopyAnnotations _| ThinLines _ | RemoveClipping | RemoveAllText ->
ThinLines _|SetAuthor _|SetTitle _|SetSubject _|SetKeywords _|SetCreate _|
SetModify _|SetCreator _|SetProducer _|SetVersion _|RemoveDictEntry _ |
RemoveClipping | SetMetadataDate _ | CreateMetadata | RemoveAllText ->
mem Pdfcrypt.NoEdit banlist mem Pdfcrypt.NoEdit banlist
let operation_allowed pdf banlist op = let operation_allowed pdf banlist op =