From 05b4201585bb30b19ea16df738fe112663279398 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Wed, 1 Nov 2023 20:47:52 +0000 Subject: [PATCH] Subformats finished and tested --- cpdfcommand.ml | 8 +++++--- cpdfmetadata.ml | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cpdfcommand.ml b/cpdfcommand.ml index 97f03e7..dff48d5 100644 --- a/cpdfcommand.ml +++ b/cpdfcommand.ml @@ -3498,9 +3498,11 @@ let go () = else (if ida ^ idb = "" then Printf.printf "ID: None" else Printf.printf "ID: %s %s\n" ida idb); let pdf = decrypt_if_necessary input (Some Info) pdf in if args.format_json then - Cpdfmetadata.output_info ~json Cpdfmetadata.UTF8 pdf; - Cpdfmetadata.output_xmp_info ~json Cpdfmetadata.UTF8 pdf; - flprint (Cpdfyojson.Safe.pretty_to_string (`Assoc (rev !json))) + begin + Cpdfmetadata.output_info ~json Cpdfmetadata.UTF8 pdf; + Cpdfmetadata.output_xmp_info ~json Cpdfmetadata.UTF8 pdf; + flprint (Cpdfyojson.Safe.pretty_to_string (`Assoc (rev !json))) + end else begin Cpdfmetadata.output_info args.encoding pdf; diff --git a/cpdfmetadata.ml b/cpdfmetadata.ml index e061ea6..cacc86c 100644 --- a/cpdfmetadata.ml +++ b/cpdfmetadata.ml @@ -129,7 +129,6 @@ let print_metadata pdf = Printf.printf "%c" (char_of_int (bget data x)) done - let get_info raw pdf = let infodict = match Pdf.lookup_direct pdf "/Info" pdf.Pdf.trailerdict with