summaryrefslogtreecommitdiff
path: root/fpdf_test.go
diff options
context:
space:
mode:
authorKurt <kurt.w.jung@gmail.com>2018-11-10 11:03:29 -0500
committerKurt <kurt.w.jung@gmail.com>2018-11-10 11:03:29 -0500
commit8d469f984ef048ff3547911bede39b7b651e8c8c (patch)
treecec153cf2688291b2ee3a694defaaf42449a1122 /fpdf_test.go
parente200d3e7c7ef20b29a47b67e58b7561f4099e7ae (diff)
parent01381ea7603b12304064fcd01a49b1cc4434b4ca (diff)
Merge branch 'ftr/gob' of https://github.com/d1ngd0/gofpdf into d1ngd0-ftr/gob
Diffstat (limited to 'fpdf_test.go')
-rw-r--r--fpdf_test.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/fpdf_test.go b/fpdf_test.go
index 4774ec6..19bc533 100644
--- a/fpdf_test.go
+++ b/fpdf_test.go
@@ -1950,10 +1950,14 @@ func ExampleFpdf_CreateTemplate() {
pdf.SetLineWidth(2.5)
pdf.SetFont("Arial", "B", 16)
+ // serialize and deserialize template
+ b, _ := template2.Serialize()
+ template3, _ := gofpdf.DeserializeTemplate(b)
+
pdf.AddPage()
- pdf.UseTemplate(template)
- pdf.UseTemplateScaled(template, gofpdf.PointType{X: 0, Y: 30}, tplSize)
- pdf.UseTemplateScaled(template, gofpdf.PointType{X: 0, Y: 60}, tplSize.ScaleBy(1.4))
+ pdf.UseTemplate(template3)
+ pdf.UseTemplateScaled(template3, gofpdf.PointType{X: 0, Y: 30}, tplSize)
+ pdf.UseTemplateScaled(template3, gofpdf.PointType{X: 0, Y: 60}, tplSize.ScaleBy(1.4))
pdf.Line(40, 210, 60, 210)
pdf.Text(40, 200, "Template example page 1")