Clean up docs for -obj

This commit is contained in:
John Whitington
2025-01-02 14:39:27 +00:00
parent 935431e52a
commit a3cbc3e365
3 changed files with 36 additions and 16 deletions

View File

@@ -3641,10 +3641,11 @@ let build_enc () =
let print_obj json pdf objspec =
let obj = Cpdftweak.find_obj pdf objspec in
let trim s = implode (rev (tl (rev (tl (explode s))))) in
if json then
print_string (Cpdfyojson.Safe.pretty_to_string (Cpdfjson.json_of_object ~utf8:true pdf (fun _ -> ()) ~no_stream_data:false ~parse_content:false obj))
else
Printf.printf "%S\n" (Pdfwrite.string_of_pdf obj)
print_endline (trim (Printf.sprintf "%S" (Pdfwrite.string_of_pdf obj)))
let extract_stream_find_obj pdf objspec =
int_of_string objspec