From 7a7f3eba295d59774758491feb161ab183321ca8 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Mon, 16 Jan 2023 14:07:11 +0800 Subject: [PATCH] more --- cpdfannot.ml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cpdfannot.ml b/cpdfannot.ml index 47f0837..d954756 100644 --- a/cpdfannot.ml +++ b/cpdfannot.ml @@ -152,8 +152,13 @@ let list_annotations_json range pdf = `List [`Int ~-n; Cpdfjson.json_of_object ~clean_strings:true pdf (fun _ -> ()) false false (Pdf.lookup_obj pdf n)]) (setify (flatten (map (Pdf.objects_referenced [] [] pdf) extra))) in - Printf.printf "EXTRA: %i objects\n" (length extra); - let json = `List (json @ extra) in + let header = + `List + [`Int 0; + Cpdfjson.json_of_object ~clean_strings:true pdf (fun _ -> ()) false false + (Pdf.Dictionary ["/CPDFJSONannotformatversion", Pdf.Integer 1])] + in + let json = `List ([header] @ json @ extra) in J.pretty_to_channel stdout json let list_annotations ~json range encoding pdf =