mirror of
https://github.com/johnwhitington/cpdf-source.git
synced 2025-06-05 22:09:39 +02:00
Plumb subformat through to -table-of-contents
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
(* cpdf command line tools *)
|
||||
let demo = false
|
||||
let agpl = false
|
||||
let agpl = true
|
||||
let major_version = 2
|
||||
let minor_version = 8
|
||||
let minor_minor_version = 1
|
||||
let version_date = "(devel, 19th December 2024)"
|
||||
let version_date = "(devel, 19th March 2025)"
|
||||
|
||||
open Pdfutil
|
||||
open Pdfio
|
||||
@@ -4799,7 +4799,7 @@ let go () =
|
||||
let pdf =
|
||||
Cpdftoc.typeset_table_of_contents
|
||||
~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
|
||||
write_pdf false pdf
|
||||
| Some (Typeset filename) ->
|
||||
|
@@ -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.
|
||||
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 *)
|
||||
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
|
||||
if process_struct_tree then ensure_minimal_struct_tree pdf;
|
||||
Hashtbl.clear width_table_cache;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
(** Table of contents *)
|
||||
|
||||
(** 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
|
||||
|
Reference in New Issue
Block a user