This commit is contained in:
John Whitington 2021-12-28 12:03:46 +00:00
parent b5ac455fb7
commit c0f5a0db54
2 changed files with 9 additions and 7 deletions

View File

@ -3,7 +3,7 @@ let demo = false
let noncomp = false
let major_version = 2
let minor_version = 5
let version_date = "(devel, 22nd Nov 2021)"
let version_date = "(devel, 28th Dec 2021)"
open Pdfutil
open Pdfio

View File

@ -85,10 +85,13 @@ let typeset_table_of_contents ~font ~fontsize ~title ~bookmark pdf =
in
let toc_pages =
let title =
let glue = Cpdftype.VGlue {glen = fontsize *. 2.; gstretch = 0.} in
if title = "" then [] else
flatten
(map
(fun l -> [Cpdftype.Text l; Cpdftype.NewLine])
(split_toc_title (of_utf8 f title)))
@ [glue]
in
let lm, rm, tm, bm =
match firstpage_cropbox with
@ -98,8 +101,7 @@ let typeset_table_of_contents ~font ~fontsize ~title ~bookmark pdf =
in
Cpdftype.typeset lm rm tm bm firstpage_papersize pdf
([Cpdftype.Font big; Cpdftype.BeginDocument] @ title @
[Cpdftype.VGlue {glen = fontsize *. 2.; gstretch = 0.};
Cpdftype.Font (f, fs)] @ flatten lines)
[Cpdftype.Font (f, fs)] @ flatten lines)
in
let toc_pages =
match firstpage_cropbox with