Correct recryption for stamping, permissions for -combine-pages
This commit is contained in:
parent
b54a1e14c5
commit
c3683b3c0b
Binary file not shown.
4
cpdf.ml
4
cpdf.ml
|
@ -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))
|
||||||
|
|
|
@ -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 _
|
||||||
|
|
Loading…
Reference in New Issue