From 60b13ad3f7a1b597152d079b336fbbed75942998 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 6 Nov 2018 14:40:12 +0100 Subject: Fix 700053: Add 'decrypt' option to pdf_save_document. This option is exposed as the -D flag to mutool clean. Allow saving a document without encryption. The next step is to allow saving a document with new encryption, but this may require a fair amount of rejigging since the PDF write code to keep separate doc->crypt objects for decryption and encryption. --- source/tools/pdfclean.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/tools/pdfclean.c') diff --git a/source/tools/pdfclean.c b/source/tools/pdfclean.c index 6d5a69be..0e7a464a 100644 --- a/source/tools/pdfclean.c +++ b/source/tools/pdfclean.c @@ -51,7 +51,7 @@ int pdfclean_main(int argc, char **argv) opts.continue_on_error = 1; opts.errors = &errors; - while ((c = fz_getopt(argc, argv, "adfgilp:scz")) != -1) + while ((c = fz_getopt(argc, argv, "adfgilp:sczD")) != -1) { switch (c) { @@ -66,6 +66,7 @@ int pdfclean_main(int argc, char **argv) case 'l': opts.do_linear += 1; break; case 'c': opts.do_clean += 1; break; case 's': opts.do_sanitize += 1; break; + case 'D': opts.do_decrypt += 1; break; default: usage(); break; } } -- cgit v1.2.3