Matterhorn stable first draft

This commit is contained in:
John Whitington 2024-07-02 17:51:33 +01:00
parent cda49a1cd8
commit bcfff5250f
1 changed files with 3 additions and 1 deletions

View File

@ -32,13 +32,15 @@ let rec read_single d =
match d with match d with
| Pdf.Dictionary d -> map fst d | Pdf.Dictionary d -> map fst d
| Pdf.Stream s -> read_single (fst !s) | Pdf.Stream s -> read_single (fst !s)
| _ -> error "read_single" | Pdf.Name n -> [n]
| x -> error "read_single"
let read_a pdf n stnode = let read_a pdf n stnode =
match Pdf.lookup_direct pdf n stnode with match Pdf.lookup_direct pdf n stnode with
| Some (Pdf.Array attrs) -> | Some (Pdf.Array attrs) ->
let attrs = keep (function Pdf.Integer _ -> false | _ -> true) attrs in let attrs = keep (function Pdf.Integer _ -> false | _ -> true) attrs in
flatten (map read_single attrs) flatten (map read_single attrs)
| Some (Pdf.Name n) -> [n]
| Some (Pdf.Dictionary d) -> | Some (Pdf.Dictionary d) ->
read_single (Pdf.Dictionary d) read_single (Pdf.Dictionary d)
| Some (Pdf.Stream s) -> | Some (Pdf.Stream s) ->