mirror of
https://github.com/johnwhitington/cpdf-source.git
synced 2025-06-05 22:09:39 +02:00
No leader if no page number
This commit is contained in:
14
cpdftoc.ml
14
cpdftoc.ml
@ -157,13 +157,13 @@ let typeset_table_of_contents ~font ~fontsize ~title ~bookmark ~dotleader pdf =
|
|||||||
let textgap = width -. margin *. 2. -. indent -. width_of_runs labelruns in
|
let textgap = width -. margin *. 2. -. indent -. width_of_runs labelruns in
|
||||||
let textruns = shorten_text fontpack fontsize (textgap -. fontsize *. 3.) textruns in
|
let textruns = shorten_text fontpack fontsize (textgap -. fontsize *. 3.) textruns in
|
||||||
let space = textgap -. width_of_runs textruns in
|
let space = textgap -. width_of_runs textruns in
|
||||||
[Cpdftype.BeginDest mark.Pdfmarks.target;
|
let leader =
|
||||||
Cpdftype.HGlue indent]
|
if dotleader && labelruns <> []
|
||||||
@ textruns @
|
then make_dots space fontpack fontsize
|
||||||
(if dotleader then make_dots space fontpack fontsize else [Cpdftype.HGlue space])
|
else [Cpdftype.HGlue space]
|
||||||
@ labelruns @
|
in
|
||||||
[Cpdftype.EndDest;
|
[Cpdftype.BeginDest mark.Pdfmarks.target; Cpdftype.HGlue indent] @ textruns @ leader @ labelruns
|
||||||
Cpdftype.NewLine])
|
@ [Cpdftype.EndDest; Cpdftype.NewLine])
|
||||||
(Pdfmarks.read_bookmarks pdf)
|
(Pdfmarks.read_bookmarks pdf)
|
||||||
in
|
in
|
||||||
let toc_pages, _ =
|
let toc_pages, _ =
|
||||||
|
Reference in New Issue
Block a user