Documentation ¶
Overview ¶
Package pagetree implements PDF page trees.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Writer ¶
Writer writes a page tree to a PDF file.
func (*Writer) AppendPage ¶
AppendPage adds a new page to the page tree.
func (*Writer) AppendPageRef ¶ added in v0.3.0
AppendPageRef adds a new page to the page tree, using the given reference for the page dictionary.
This function takes ownership of the pageDict object, and adds the /Parent entry before writing the object to the PDF file.
func (*Writer) Close ¶
Close closes the current tree and all subtrees. After a tree has been closed, no more pages can be added.
If the tree is the root of a page tree, the complete tree is written to the PDF file and a reference to the root node is returned. Otherwise, the returned reference is nil.
TODO(voss): get rid of the Reference return value
func (*Writer) NewRange ¶ added in v0.3.4
NewRange creates a new Writer that can insert pages into a PDF document at position position current at the time of the call. Pages added to the parent Writer will be inserted after the pages from the newly returned Writer.
func (*Writer) NextPageNumber ¶
NextPageNumber registers a callback that will be called when the absolute page number of the next page to be added is known. Page numbers are relative to the start of the document, starting at 0.
The callback will be called with -1 if the page tree is closed before another page is added.