From 95d44939de4aa01070de11803eb5d2fc546629d0 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Mon, 3 Apr 2023 17:10:29 +0100 Subject: [PATCH] Allow noncomp to use -producer / -set-producer --- cpdfcommand.ml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cpdfcommand.ml b/cpdfcommand.ml index aea77ec..43a9b77 100644 --- a/cpdfcommand.ml +++ b/cpdfcommand.ml @@ -3110,9 +3110,10 @@ let set_creator s pdf = let really_write_pdf ?(encryption = None) ?(is_decompress=false) mk_id pdf outname = if args.producer <> None then set_producer (unopt args.producer) pdf; - if noncomp then - set_producer "cpdf non-commercial use only. To buy: http://coherentpdf.com/" - pdf; + if noncomp && + (match args.op with Some (SetProducer _) -> false | _ -> match args.producer with None -> true | _ -> false) + then + set_producer "cpdf non-commercial use only. To buy: http://coherentpdf.com/" pdf; if args.creator <> None then set_creator (unopt args.creator) pdf; if args.debugcrypt then Printf.printf "really_write_pdf\n%!"; let will_linearize =