summaryrefslogtreecommitdiff
path: root/fpdf_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'fpdf_test.go')
-rw-r--r--fpdf_test.go16
1 files changed, 3 insertions, 13 deletions
diff --git a/fpdf_test.go b/fpdf_test.go
index e212d95..19bc533 100644
--- a/fpdf_test.go
+++ b/fpdf_test.go
@@ -19,7 +19,6 @@ package gofpdf_test
import (
"bufio"
"bytes"
- "encoding/gob"
"fmt"
"io"
"io/ioutil"
@@ -1951,18 +1950,9 @@ func ExampleFpdf_CreateTemplate() {
pdf.SetLineWidth(2.5)
pdf.SetFont("Arial", "B", 16)
- template3 := new(gofpdf.FpdfTpl)
- b := new(bytes.Buffer)
- enc := gob.NewEncoder(b)
-
- if err := enc.Encode(template); err != nil {
- pdf.SetError(err)
- }
-
- dec := gob.NewDecoder(b)
- if err := dec.Decode(template3); err != nil {
- pdf.SetError(err)
- }
+ // serialize and deserialize template
+ b, _ := template2.Serialize()
+ template3, _ := gofpdf.DeserializeTemplate(b)
pdf.AddPage()
pdf.UseTemplate(template3)