First structure tree showing in WNI
This commit is contained in:
parent
1e78d4cf8a
commit
188ecd20f2
20
cpdfdraw.ml
20
cpdfdraw.ml
|
@ -477,14 +477,18 @@ let write_structure_tree pdf st =
|
||||||
let items =
|
let items =
|
||||||
map
|
map
|
||||||
(function StItem {kind; pageobjnum; children} ->
|
(function StItem {kind; pageobjnum; children} ->
|
||||||
Pdf.Dictionary [("/S", Pdf.Name kind);
|
let this_objnum = Pdf.addobj pdf Pdf.Null in
|
||||||
("/Pg", Pdf.Indirect pageobjnum);
|
let this_obj =
|
||||||
("/P", Pdf.Indirect struct_tree_root);
|
Pdf.Dictionary [("/S", Pdf.Name kind);
|
||||||
("/K", Pdf.Array (map (function StMCID x ->
|
("/Pg", Pdf.Indirect pageobjnum);
|
||||||
let n = Pdf.addobj pdf (Pdf.Integer x) in
|
("/P", Pdf.Indirect struct_tree_root);
|
||||||
parentmap =| (string_of_int x, Pdf.Indirect n);
|
("/K", Pdf.Array (map (function StMCID x ->
|
||||||
Pdf.Indirect (Pdf.addobj pdf (Pdf.Integer x))
|
parentmap =| (string_of_int x, Pdf.Array [Pdf.Indirect this_objnum]);
|
||||||
| _ -> assert false) children))]
|
Pdf.Integer x
|
||||||
|
| _ -> assert false) children))]
|
||||||
|
in
|
||||||
|
Pdf.addobj_given_num pdf (this_objnum, this_obj);
|
||||||
|
Pdf.Indirect this_objnum
|
||||||
| _ -> assert false
|
| _ -> assert false
|
||||||
)
|
)
|
||||||
st
|
st
|
||||||
|
|
Loading…
Reference in New Issue