summaryrefslogtreecommitdiff
path: root/def.go
diff options
context:
space:
mode:
authorKurt Jung <kurt.w.jung@code.google.com>2013-09-08 09:31:34 -0400
committerKurt Jung <kurt.w.jung@code.google.com>2013-09-08 09:31:34 -0400
commit642428cd0e23a9792acfcb073156fe0b72eb142f (patch)
tree352c26ecf04972138fb341fee346e55770c62d4b /def.go
parent845888136482c81fd76860b57e254c0e8fa6c149 (diff)
Bookmark outline support submitted by Manuel Cornes
Diffstat (limited to 'def.go')
-rw-r--r--def.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/def.go b/def.go
index d877f9c..ed37f11 100644
--- a/def.go
+++ b/def.go
@@ -79,6 +79,14 @@ type intLinkType struct {
y float64
}
+// outlineType is used for a sidebar outline of bookmarks
+type outlineType struct {
+ text string
+ level, parent, first, last, next, prev int
+ y float64
+ p int
+}
+
// InitType is used with NewCustom() to customize an Fpdf instance.
// OrientationStr, UnitStr, SizeStr and FontDirStr correspond to the arguments
// accepted by New(). If the Wd and Ht fields of Size are each greater than
@@ -92,6 +100,7 @@ type InitType struct {
FontDirStr string
}
+// Principal structure for creating a single PDF document
type Fpdf struct {
page int // current page number
n int // current object number
@@ -137,6 +146,8 @@ type Fpdf struct {
images map[string]imageInfoType // array of used images
pageLinks [][]linkType // pageLinks[page][link], both 1-based
links []intLinkType // array of internal links
+ outlines []outlineType // array of outlines
+ outlineRoot int // root of outlines
autoPageBreak bool // automatic page breaking
acceptPageBreak func() bool // returns true to accept page break
pageBreakTrigger float64 // threshold used to trigger page breaks