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