Plumb subformat through to -table-of-contents

This commit is contained in:
John Whitington
2025-03-19 16:28:06 +00:00
parent c46d510eb2
commit de114111f8
3 changed files with 5 additions and 5 deletions

View File

@@ -1,10 +1,10 @@
(* cpdf command line tools *) (* cpdf command line tools *)
let demo = false let demo = false
let agpl = false let agpl = true
let major_version = 2 let major_version = 2
let minor_version = 8 let minor_version = 8
let minor_minor_version = 1 let minor_minor_version = 1
let version_date = "(devel, 19th December 2024)" let version_date = "(devel, 19th March 2025)"
open Pdfutil open Pdfutil
open Pdfio open Pdfio
@@ -4799,7 +4799,7 @@ let go () =
let pdf = let pdf =
Cpdftoc.typeset_table_of_contents Cpdftoc.typeset_table_of_contents
~font:cpdffont ~fontsize:args.fontsize ~title:args.toc_title ~font:cpdffont ~fontsize:args.fontsize ~title:args.toc_title
~bookmark:args.toc_bookmark ~dotleader:args.dot_leader ~process_struct_tree:args.process_struct_trees pdf ~bookmark:args.toc_bookmark ~dotleader:args.dot_leader ~process_struct_tree:args.process_struct_trees ?subformat:args.subformat pdf
in in
write_pdf false pdf write_pdf false pdf
| Some (Typeset filename) -> | Some (Typeset filename) ->

View File

@@ -167,7 +167,7 @@ let ensure_minimal_struct_tree pdf =
(* TODO Fix Cpdftype to take a box not a papersize/margins combo. Then we can remove all the CropBox/Mediabox complications here. (* TODO Fix Cpdftype to take a box not a papersize/margins combo. Then we can remove all the CropBox/Mediabox complications here.
Then copying the boxes directly from the first page of the document is ok, and we just prefer the cropbox. Failing file Then copying the boxes directly from the first page of the document is ok, and we just prefer the cropbox. Failing file
__PDFUA/decomp/08.pdf *) __PDFUA/decomp/08.pdf *)
let typeset_table_of_contents ~font ~fontsize ~title ~bookmark ~dotleader ~process_struct_tree pdf = let typeset_table_of_contents ~font ~fontsize ~title ~bookmark ~dotleader ~process_struct_tree ?subformat pdf =
let optional l = if process_struct_tree then l else [] in let optional l = if process_struct_tree then l else [] in
if process_struct_tree then ensure_minimal_struct_tree pdf; if process_struct_tree then ensure_minimal_struct_tree pdf;
Hashtbl.clear width_table_cache; Hashtbl.clear width_table_cache;

View File

@@ -1,4 +1,4 @@
(** Table of contents *) (** Table of contents *)
(** Typeset a table of contents and prepend to the document. *) (** Typeset a table of contents and prepend to the document. *)
val typeset_table_of_contents : font:Cpdfembed.cpdffont -> fontsize:float -> title:string -> bookmark:bool -> dotleader:bool -> process_struct_tree:bool -> Pdf.t -> Pdf.t val typeset_table_of_contents : font:Cpdfembed.cpdffont -> fontsize:float -> title:string -> bookmark:bool -> dotleader:bool -> process_struct_tree:bool -> ?subformat:Cpdfua.subformat -> Pdf.t -> Pdf.t