summaryrefslogtreecommitdiff
path: root/fpdf.go
diff options
context:
space:
mode:
authorKurt Jung <kurt.w.jung@code.google.com>2014-09-16 22:38:49 -0400
committerKurt Jung <kurt.w.jung@code.google.com>2014-09-16 22:38:49 -0400
commitcbbfe21f94ea53f0800feaf4e9c06c038ddc1e6e (patch)
tree952009ff7b8098e3ffc10c96fe88887e7a78ffa4 /fpdf.go
parent9f16b52334238f446dbafcbe06ffff0637403361 (diff)
Added layer functionality. This allows content to be placed into layers, the visibility of which can be controlled from the document reader.
Diffstat (limited to 'fpdf.go')
-rw-r--r--fpdf.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/fpdf.go b/fpdf.go
index 20705b8..5fd3f63 100644
--- a/fpdf.go
+++ b/fpdf.go
@@ -173,6 +173,7 @@ func fpdfNew(orientationStr, unitStr, sizeStr, fontDirStr string, size SizeType)
f.gradientList = append(f.gradientList, gradientType{}) // gradientList[0] is unused
// Set default PDF version number
f.pdfVersion = "1.3"
+ f.layerInit()
return
}
@@ -2346,6 +2347,7 @@ func (f *Fpdf) beginpage(orientationStr string, size SizeType) {
}
func (f *Fpdf) endpage() {
+ f.EndLayer()
f.state = 1
}
@@ -3028,7 +3030,8 @@ func (f *Fpdf) putresourcedict() {
}
f.out(">>")
}
-
+ // Layers
+ f.layerPutResourceDict()
}
func (f *Fpdf) putBlendModes() {
@@ -3072,6 +3075,7 @@ func (f *Fpdf) putresources() {
if f.err != nil {
return
}
+ f.layerPutLayers()
f.putBlendModes()
f.putGradients()
f.putfonts()
@@ -3148,6 +3152,8 @@ func (f *Fpdf) putcatalog() {
f.outf("/Outlines %d 0 R", f.outlineRoot)
f.out("/PageMode /UseOutlines")
}
+ // Layers
+ f.layerPutCatalog()
}
func (f *Fpdf) putheader() {
@@ -3224,6 +3230,7 @@ func (f *Fpdf) enddoc() {
if f.err != nil {
return
}
+ f.layerEndDoc()
f.putheader()
f.putpages()
f.putresources()