From fb526d256c0eca514730bcf23a7eae35a8a3b795 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Fri, 21 Jun 2024 14:16:52 +0100 Subject: [PATCH] Further annotation matterhorns --- cpdfua.ml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/cpdfua.ml b/cpdfua.ml index acacf7b..6711f7b 100644 --- a/cpdfua.ml +++ b/cpdfua.ml @@ -660,10 +660,30 @@ let matterhorn_28_009 _ _ pdf = merror () (* A widget annotation is not nested within a
tag. *) -let matterhorn_28_010 _ _ pdf = todo () +let matterhorn_28_010 _ _ pdf = + Pdf.objiter + (fun _ o -> + match Pdf.lookup_direct pdf "/Subtype" o with + | Some (Pdf.Name "/Widget") -> + begin match Pdf.lookup_chain pdf o ["/StructParent"; "/S"] with + | Some (Pdf.Name "/Form") -> () + | _ -> merror () + end + | _ -> ()) + pdf (* A link annotation is not nested within a tag. *) -let matterhorn_28_011 _ _ pdf = todo () +let matterhorn_28_011 _ _ pdf = + Pdf.objiter + (fun _ o -> + match Pdf.lookup_direct pdf "/Subtype" o with + | Some (Pdf.Name "/Link") -> + begin match Pdf.lookup_chain pdf o ["/StructParent"; "/S"] with + | Some (Pdf.Name "/Link") -> () + | _ -> merror () + end + | _ -> ()) + pdf (* A link annotation does not include an alternate description in its Contents entry. *)