Move autotagging text from sections to text/para

This commit is contained in:
John Whitington 2024-10-21 14:11:51 +01:00
parent e39af4218a
commit 0efd0b0a50
1 changed files with 12 additions and 1 deletions

View File

@ -460,7 +460,18 @@ let rec ops_of_drawop struct_tree dryrun pdf endpage filename bates batespad num
flatten
(map
(function para ->
(if not !first && indent = None then ([Pdfops.Op_T']) else (clear first; [])) @ format_paragraph (if indent <> None && not !first then unopt indent else 0.) j w para)
let begintag =
let m = mcid () in
if not dryrun && !do_auto_tag then structdata := StDataMCID ("/P", m)::!structdata;
if struct_tree && !do_auto_tag then [Pdfops.Op_BDC ("/P", Pdf.Dictionary ["/MCID", Pdf.Integer m])] else []
in
let endtag =
if struct_tree && !do_auto_tag then [Pdfops.Op_EMC] else []
in
begintag
@ (if not !first && indent = None then [Pdfops.Op_T'] else (clear first; []))
@ format_paragraph (if indent <> None && not !first then unopt indent else 0.) j w para
@ endtag)
s)
| Leading f -> [Pdfops.Op_TL f]
| CharSpace f -> [Pdfops.Op_Tc f]