From 768ebf193564cacb00171a2236ade5cfbb653ba4 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Thu, 6 Jun 2024 17:10:52 +0100 Subject: [PATCH] Reference object check --- cpdfua.ml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/cpdfua.ml b/cpdfua.ml index b6877c7..6c60ee2 100644 --- a/cpdfua.ml +++ b/cpdfua.ml @@ -214,8 +214,23 @@ let matterhorn_28_015 pdf = () let matterhorn_28_016 pdf = () let matterhorn_28_017 pdf = () let matterhorn_28_018 pdf = () -let matterhorn_30_001 pdf = () -let matterhorn_30_002 pdf = () + +(* A reference XObject is present. *) +let matterhorn_30_001 pdf = + Pdf.objiter + (fun _ o -> + match Pdf.lookup_direct pdf "/Subtype" o, Pdf.lookup_direct pdf "/Ref" o with + | Some (Pdf.Name "/Form"), Some _ -> merror () + | _ -> ()) + pdf + +(* Form XObject contains MCIDs and is referenced more than once. *) +let matterhorn_30_002 pdf = + (* We need to consider inheritence here. What solutions do we already have for that, and do we + need anything new? *) + () + + let matterhorn_31_001 pdf = () let matterhorn_31_002 pdf = () let matterhorn_31_003 pdf = ()