From 1b54303be91bc00795f634164645a89e02a10e8d Mon Sep 17 00:00:00 2001 From: John Whitington Date: Wed, 15 Nov 2023 16:54:00 +0000 Subject: [PATCH] -info shows if AcroForm present --- cpdfmetadata.ml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cpdfmetadata.ml b/cpdfmetadata.ml index cacc86c..94f05ac 100644 --- a/cpdfmetadata.ml +++ b/cpdfmetadata.ml @@ -169,6 +169,7 @@ let get_catalog_item name pdf = | Some catalog -> begin match Pdf.lookup_direct pdf name catalog with | Some (Pdf.Name x) when x <> "" -> implode (tl (explode x)) + | Some (Pdf.Dictionary _) -> "True" | _ -> "" end | _ -> "" @@ -230,6 +231,8 @@ let output_info ?(json=ref [("none", `Null)]) encoding pdf = json =| ("DisplayDocTitle", match get_viewer_pref_item "/DisplayDocTitle" pdf with "" -> `Null | s -> `Bool (bool_of_string s)); if notjson then Printf.printf "NonFullScreenPageMode: %s\n" (get_viewer_pref_item "/NonFullScreenPageMode" pdf); json =| ("NonFullPageScreenMode", match (get_viewer_pref_item "/NonFullPageScreenMode" pdf) with "" -> `Null | x -> `String x); + if notjson then Printf.printf "AcroForm: %s\n" (match get_catalog_item "/AcroForm" pdf with "" -> "False" | x -> x); + json =| ("AcroForm", match (get_catalog_item "/AcroForm" pdf) with "" -> `Bool false | x -> `Bool true); type xmltree = E of Cpdfxmlm.tag * xmltree list