diff --git a/Changes b/Changes index fce9620..614da8b 100644 --- a/Changes +++ b/Changes @@ -13,6 +13,7 @@ o -obj JSON output * -print-dict-entry, -remove-dict-entry and -replace-dict-entry can follow a chain from each found dictionary entry * Much more of the PDF/UA Matterhorn verification suite implemented +* PDF/UA verifier now returns extra information with most failures * Font lister now returns the font itself o Allow %objnum in output name for -extract-images * -show-boxes, -trim-marks, -table-of-contents, -add-text diff --git a/cpdfua.ml b/cpdfua.ml index b797780..c127b9f 100644 --- a/cpdfua.ml +++ b/cpdfua.ml @@ -502,14 +502,14 @@ let matterhorn_10_001 _ _ pdf = | Some d -> begin match Pdf.lookup_direct pdf "/Differences" d with | Some diffs -> check_diffs diffs (* b) 2 *) - | None -> merror () + | None -> merror_str "No /Differences" end | None -> match Pdf.lookup_direct pdf "/Subtype" font with | Some (Pdf.Name "/Type0") -> (* c) *) unimpl () - | _ -> merror () + | _ -> merror_str "Not a Type 0 font" in let fonts = map (fun (_, _, _, _, _, x) -> x) (Cpdffont.list_fonts pdf (ilist 1 (Pdfpage.endpage pdf))) in iter @@ -525,7 +525,8 @@ let matterhorn_10_001 _ _ pdf = (* Natural language for text in page content cannot be determined. *) let matterhorn_11_001 _ _ pdf = match Pdf.lookup_chain pdf pdf.Pdf.trailerdict ["/Root"; "/Lang"] with - | Some (Pdf.String "") | None -> merror_str "No top-level /Lang" + | Some (Pdf.String "") -> merror_str "Top-level /Lang is empty" + | None -> merror_str "No top-level /Lang" | Some _ -> () (* Natural language for text in Alt, ActualText and E attributes cannot be @@ -572,7 +573,7 @@ let rec headings_list_of_tree (E (n, cs)) = let matterhorn_14_002 st _ _ = match headings_list_of_tree st with | [] | "/H1"::_ -> () - | _ -> merror () + | x::_ -> merror_str x (* Numbered heading levels in descending sequence are skipped (Example: