summaryrefslogtreecommitdiff
path: root/fpdf_test.go
diff options
context:
space:
mode:
authorKurt Jung <kurt.w.jung@gmail.com>2015-10-20 12:26:10 -0400
committerKurt Jung <kurt.w.jung@gmail.com>2015-10-20 12:26:10 -0400
commite2d935b7215daa9476f1ca385a15227f5f5a7011 (patch)
tree56b837702a1d3b036e081506513d79913389875f /fpdf_test.go
parent26baf7d305543d6afe39d38f0b2c30054c9fa4e3 (diff)
parentf45e5e9196bb313883f36e0ccc72f052f46aa37e (diff)
Merge pull request #49 from jung-kurt/compare-reference-pdf
Compare example PDFs with reference copies
Diffstat (limited to 'fpdf_test.go')
-rw-r--r--fpdf_test.go15
1 files changed, 10 insertions, 5 deletions
diff --git a/fpdf_test.go b/fpdf_test.go
index 966767f..596816c 100644
--- a/fpdf_test.go
+++ b/fpdf_test.go
@@ -40,9 +40,14 @@ func init() {
func cleanup() {
filepath.Walk(example.PdfDir(),
func(path string, info os.FileInfo, err error) (reterr error) {
- if len(path) > 3 {
- if path[len(path)-4:] == ".pdf" {
- os.Remove(path)
+ if info.Mode().IsRegular() {
+ dir, _ := filepath.Split(path)
+ if "reference" != filepath.Base(dir) {
+ if len(path) > 3 {
+ if path[len(path)-4:] == ".pdf" {
+ os.Remove(path)
+ }
+ }
}
}
return
@@ -1728,8 +1733,8 @@ func ExampleFpdf_CreateTemplate() {
pdf.AddPage()
pdf.UseTemplate(template)
- pdf.UseTemplateScaled(template, gofpdf.PointType{0, 30}, tplSize)
- pdf.UseTemplateScaled(template, gofpdf.PointType{0, 60}, tplSize.ScaleBy(1.4))
+ pdf.UseTemplateScaled(template, gofpdf.PointType{X: 0, Y: 30}, tplSize)
+ pdf.UseTemplateScaled(template, gofpdf.PointType{X: 0, Y: 60}, tplSize.ScaleBy(1.4))
pdf.Line(40, 210, 60, 210)
pdf.Text(40, 200, "Template example page 1")