mirror of
https://github.com/unidoc/unipdf.git
synced 2025-05-02 22:17:06 +08:00
Add SetTOC method to the creator
This commit is contained in:
parent
89965a3784
commit
287b6e29ca
@ -142,6 +142,16 @@ func (c *Creator) TOC() *TOC {
|
||||
return c.toc
|
||||
}
|
||||
|
||||
// SetTOC sets the table of content component of the creator.
|
||||
// This method should be used when building a custom table of contents.
|
||||
func (c *Creator) SetTOC(toc *TOC) {
|
||||
if toc == nil {
|
||||
return
|
||||
}
|
||||
|
||||
c.toc = toc
|
||||
}
|
||||
|
||||
func (c *Creator) setActivePage(p *model.PdfPage) {
|
||||
c.activePage = p
|
||||
}
|
||||
@ -293,8 +303,8 @@ func (c *Creator) Context() DrawContext {
|
||||
return c.context
|
||||
}
|
||||
|
||||
// Call before writing out. Takes care of adding headers and footers, as well as generating front
|
||||
// Page and table of contents.
|
||||
// Call before writing out. Takes care of adding headers and footers, as well
|
||||
// as generating front Page and table of contents.
|
||||
func (c *Creator) finalize() error {
|
||||
totPages := len(c.pages)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user