mirror of
https://github.com/unidoc/unipdf.git
synced 2025-04-29 13:48:54 +08:00
Add TOC page outline item
This commit is contained in:
parent
a89213f7c0
commit
a9747036a1
@ -453,6 +453,19 @@ func (c *Creator) finalize() error {
|
||||
for _, outlineItem := range outlineItems {
|
||||
adjustOutlineDest(outlineItem)
|
||||
}
|
||||
|
||||
// Add outline TOC item.
|
||||
if c.AddTOC {
|
||||
var tocPage int64
|
||||
if hasFrontPage {
|
||||
tocPage = 1
|
||||
}
|
||||
|
||||
c.outline.Insert(0, model.NewOutlineItem(
|
||||
"Table of Contents",
|
||||
model.NewOutlineDest(tocPage, 0, c.pageHeight),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
for idx, page := range c.pages {
|
||||
|
Loading…
x
Reference in New Issue
Block a user