Merge permissions now fixed

This commit is contained in:
John Whitington 2014-11-05 14:05:20 +00:00
parent 60c055141f
commit 5467114631
1 changed files with 21 additions and 9 deletions

View File

@ -2898,8 +2898,20 @@ let go () =
write_pdf false pdf write_pdf false pdf
| _ -> | _ ->
(* We check permissions. A merge is allowed if each file (* We check permissions. A merge is allowed if each file
included was (a) not encrypted, or (b) decrypted using included was (a) not encrypted (detected by the absence of
the owner password *) saved encryption information in the PDF, or (b) decrypted using
the owner password (stored in the input) *)
if
not
(fold_left ( && ) true
(map2
(fun (_, _, _, _, _, was_dec_with_owner) pdf ->
!was_dec_with_owner || pdf.Pdf.saved_encryption = None)
inputs
pdfs))
then
soft_error "Merge requires the owner password for all encrypted files."
else
(* If args.keep_this_id is set, change the ID to the one from the kept one *) (* If args.keep_this_id is set, change the ID to the one from the kept one *)
let rangenums = map2 parse_pagespec pdfs ranges in let rangenums = map2 parse_pagespec pdfs ranges in
let outpdf = let outpdf =