This commit is contained in:
John Whitington 2024-10-04 12:24:50 +01:00
parent 5f4a9b05b9
commit 418e3a8bcc
1 changed files with 3 additions and 3 deletions

View File

@ -95,7 +95,7 @@ let typeset ~process_struct_tree ?subformat ?title ~papersize ~font ~fontsize te
[firstfont; Cpdftype.BeginDocument] @ tagged [firstfont; Cpdftype.BeginDocument] @ tagged
in in
let pages, tags = Cpdftype.typeset ~process_struct_tree margin margin margin margin papersize pdf instrs in let pages, tags = Cpdftype.typeset ~process_struct_tree margin margin margin margin papersize pdf instrs in
iter (fun x -> Printf.printf "PAGE\n"; iter (fun (_, i) -> Printf.printf "Paragraph number %i\n" i) x) tags; (*iter (fun x -> Printf.printf "PAGE\n"; iter (fun (_, i) -> Printf.printf "Paragraph number %i\n" i) x) tags;*)
(* We make (tag number, page number, mcid) triples *) (* We make (tag number, page number, mcid) triples *)
let tagtriples = let tagtriples =
flatten flatten
@ -105,8 +105,8 @@ let typeset ~process_struct_tree ?subformat ?title ~papersize ~font ~fontsize te
(indx0 tags) (indx0 tags)
tags) tags)
in in
Printf.printf "(paragraph number, page number, mcid) triples:\n"; (* Printf.printf "(paragraph number, page number, mcid) triples:\n";
iter (fun (tagnum, pn, mcid) -> Printf.printf "%i, %i, %i\n" tagnum pn mcid) tagtriples; iter (fun (tagnum, pn, mcid) -> Printf.printf "%i, %i, %i\n" tagnum pn mcid) tagtriples;*)
(* Now work out the nodes and which MCIDs in which pages they point to. Each paragraph may point to 1 or more nodes. *) (* Now work out the nodes and which MCIDs in which pages they point to. Each paragraph may point to 1 or more nodes. *)
let rec find_nodes (a : ((int * int * int) list) list) = function let rec find_nodes (a : ((int * int * int) list) list) = function
| (para, page, mcid)::nodes -> | (para, page, mcid)::nodes ->