From 74c4920991ec4e092debbaefffe119b50a30b1ca Mon Sep 17 00:00:00 2001 From: John Whitington Date: Wed, 19 Mar 2025 16:49:06 +0000 Subject: [PATCH] more --- cpdftoc.ml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpdftoc.ml b/cpdftoc.ml index fc0211f..1eee4fd 100644 --- a/cpdftoc.ml +++ b/cpdftoc.ml @@ -346,6 +346,8 @@ let typeset_table_of_contents ~font ~fontsize ~title ~bookmark ~dotleader ~proce toc_pageobjnums toc_structure_items_per_page; remove_parent_tree_next_key pdf; + (* FIXME: When the subformat is PDF/UA-2 we need to locate the top-level + document and put our content inside it, not before it. *) begin match Pdf.lookup_chain pdf pdf.Pdf.trailerdict ["/Root"; "/StructTreeRoot"; "/K"] with | Some (Pdf.Array a) -> Pdf.replace_chain pdf ["/Root"; "/StructTreeRoot"; "/K"] (Pdf.Array (prepending_structitems @ a))