From 22928a541d074d5a239ba3d34ef0855a18d93d33 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Sat, 22 Feb 2025 15:32:59 +0000 Subject: [PATCH] Adds Wmode check --- cpdfua.ml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cpdfua.ml b/cpdfua.ml index fe0a6ec..cad4830 100644 --- a/cpdfua.ml +++ b/cpdfua.ml @@ -1189,12 +1189,10 @@ the CMap stream. *) let matterhorn_31_007 _ _ pdf = Pdf.objiter (fun _ o -> - (* 1. Locate all places a CMap dictionary can be *) - (* 2. Get at the CMap and read the wmode *) - (* 3. Read the wmode from the cmap dictionary *) - (* 4. Whinge if different. *) - () - ) + match Pdf.lookup_direct pdf "/WMode" o with + | Some (Pdf.Integer fromdict) -> + if (Pdfcmap.parse_cmap pdf o).wmode <> Some fromdict then merror () + | _ -> ()) pdf (* A CMap references another CMap which is not listed in ISO 32000-1:2008,