From 634d64e47f82f23bc8cd7a05464a9defc66fee08 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 1 Dec 2017 15:28:32 +0100 Subject: Add 'clean' option to pdfclean to clean (but not sanitize) content streams. This goes well with the 'mutool clean -d' decompression option to debug content streams, without doing the sanitize optimization pass. --- source/tools/pdfclean.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source/tools') diff --git a/source/tools/pdfclean.c b/source/tools/pdfclean.c index ff60bbb5..6d5a69be 100644 --- a/source/tools/pdfclean.c +++ b/source/tools/pdfclean.c @@ -31,7 +31,8 @@ static void usage(void) "\t-z\tdeflate uncompressed streams\n" "\t-f\tcompress font streams\n" "\t-i\tcompress image streams\n" - "\t-s\tclean content streams\n" + "\t-c\tclean content streams\n" + "\t-s\tsanitize content streams\n" "\tpages\tcomma separated list of page numbers and ranges\n" ); exit(1); @@ -50,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:sz")) != -1) + while ((c = fz_getopt(argc, argv, "adfgilp:scz")) != -1) { switch (c) { @@ -63,7 +64,8 @@ int pdfclean_main(int argc, char **argv) case 'a': opts.do_ascii += 1; break; case 'g': opts.do_garbage += 1; break; case 'l': opts.do_linear += 1; break; - case 's': opts.do_clean += 1; break; + case 'c': opts.do_clean += 1; break; + case 's': opts.do_sanitize += 1; break; default: usage(); break; } } -- cgit v1.2.3