mirror of
https://github.com/johnwhitington/cpdf-source.git
synced 2025-03-09 16:10:12 +01:00
No leader if no page number
This commit is contained in:
parent
3ba639824c
commit
7145a558eb
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 textruns = shorten_text fontpack fontsize (textgap -. fontsize *. 3.) textruns in
|
||||
let space = textgap -. width_of_runs textruns in
|
||||
[Cpdftype.BeginDest mark.Pdfmarks.target;
|
||||
Cpdftype.HGlue indent]
|
||||
@ textruns @
|
||||
(if dotleader then make_dots space fontpack fontsize else [Cpdftype.HGlue space])
|
||||
@ labelruns @
|
||||
[Cpdftype.EndDest;
|
||||
Cpdftype.NewLine])
|
||||
let leader =
|
||||
if dotleader && labelruns <> []
|
||||
then make_dots space fontpack fontsize
|
||||
else [Cpdftype.HGlue space]
|
||||
in
|
||||
[Cpdftype.BeginDest mark.Pdfmarks.target; Cpdftype.HGlue indent] @ textruns @ leader @ labelruns
|
||||
@ [Cpdftype.EndDest; Cpdftype.NewLine])
|
||||
(Pdfmarks.read_bookmarks pdf)
|
||||
in
|
||||
let toc_pages, _ =
|
||||
|
Loading…
x
Reference in New Issue
Block a user