Permissions for -combine-pages

This commit is contained in:
John Whitington 2014-11-17 14:48:56 +00:00
parent c3683b3c0b
commit 29f663e85b

View File

@ -586,6 +586,13 @@ let rec decrypt_if_necessary (_, _, _, user_pw, owner_pw, was_dec_with_owner) op
| Some x -> Printf.printf "decrypt_if_necessary: op = %s\n" (string_of_op x)
end;
if not (Pdfcrypt.is_encrypted pdf) then pdf else
match op with Some (CombinePages _) ->
(* This is a hack because we don't have support for recryption on combine
* pages. This is pervented by permissions above, but in the case that the
* owner password is blank (e.g christmas_tree_lights.pdf), we would end
* up here. *)
soft_error "Combine pages: both files must be unencrypted for this operation."
| _ ->
match Pdfcrypt.decrypt_pdf_owner owner_pw pdf with
| Some pdf ->
args.was_decrypted_with_owner <- true;