Correct recryption for stamping, permissions for -combine-pages

This commit is contained in:
John Whitington 2014-11-16 16:01:12 +00:00
parent b54a1e14c5
commit c3683b3c0b
3 changed files with 28 additions and 22 deletions

BIN
blankowneruser.pdf Normal file

Binary file not shown.

View File

@ -2177,6 +2177,10 @@ let stamp position fast scale_to_fit isover range over pdf =
~rotations:[Pdfmerge.DNR; Pdfmerge.DNR] ~rotations:[Pdfmerge.DNR; Pdfmerge.DNR]
false false ["a"; "b"] [pdf; over_firstpage_pdf] [pageseqs; [1]] false false ["a"; "b"] [pdf; over_firstpage_pdf] [pageseqs; [1]]
in in
let merged =
{merged with Pdf.saved_encryption = pdf.Pdf.saved_encryption}
in
let merged = copy_id true pdf merged in
let renamed_pdf = let renamed_pdf =
Pdfpage.change_pages true Pdfpage.change_pages true
merged (Pdfpage.renumber_pages merged (Pdfpage.pages_of_pagetree merged)) merged (Pdfpage.renumber_pages merged (Pdfpage.pages_of_pagetree merged))

View File

@ -556,7 +556,9 @@ let banned banlist = function
| ListBookmarks | ImageResolution _ | MissingFonts | ListBookmarks | ImageResolution _ | MissingFonts
| PrintPageLabels | Clean | Compress | Decompress | PrintPageLabels | Clean | Compress | Decompress
| RemoveUnusedResources | ChangeId | CopyId _ -> false (* Always allowed *) | RemoveUnusedResources | ChangeId | CopyId _ -> false (* Always allowed *)
| Decrypt | Encrypt -> true (* Never allowed *) (* Combine pages is not allowed because we would not know where to get the
-recrypt from -- the first or second file? *)
| Decrypt | Encrypt | CombinePages _ -> true (* Never allowed *)
| ExtractText | ExtractImages | ExtractFontFile -> mem Pdfcrypt.NoExtract banlist | ExtractText | ExtractImages | ExtractFontFile -> mem Pdfcrypt.NoExtract banlist
| AddBookmarks _ | PadBefore | PadAfter | PadEvery _ | PadMultiple _ | AddBookmarks _ | PadBefore | PadAfter | PadEvery _ | PadMultiple _
| Merge | Split | SplitOnBookmarks _ | RotateContents _ | Rotate _ | Merge | Split | SplitOnBookmarks _ | RotateContents _ | Rotate _