Recryption with owner password begun

This commit is contained in:
John Whitington 2014-11-02 14:59:37 +00:00
parent a03b90a3b5
commit 410954b4f7
1 changed files with 8 additions and 7 deletions

View File

@ -1943,13 +1943,14 @@ let really_write_pdf ?(encryption = None) ?(is_decompress=false) mk_id pdf outna
if args.debugcrypt then Printf.printf "Recrypting in really_write_pdf\n"; if args.debugcrypt then Printf.printf "Recrypting in really_write_pdf\n";
match args.inputs with match args.inputs with
[] -> raise (Pdf.PDFError "no input in recryption") [] -> raise (Pdf.PDFError "no input in recryption")
| (_, _, _, user_pw, _)::_ -> | (_, _, _, user_pw, owner_pw)::_ ->
Pdfwrite.pdf_to_file_options let best_password = if owner_pw <> "" then owner_pw else user_pw in
~preserve_objstm:args.preserve_objstm Pdfwrite.pdf_to_file_options
~generate_objstm:args.create_objstm ~preserve_objstm:args.preserve_objstm
~compress_objstm:(not is_decompress) ~generate_objstm:args.create_objstm
~recrypt:(Some user_pw) ~compress_objstm:(not is_decompress)
false None mk_id pdf outname' ~recrypt:(Some best_password)
false None mk_id pdf outname'
end end
else else
begin begin