summaryrefslogtreecommitdiff
path: root/pdf
diff options
context:
space:
mode:
authorJoop Kiefte <ikojba@gmail.com>2020-11-20 06:38:06 +0200
committerJoop Kiefte <ikojba@gmail.com>2020-11-20 06:38:06 +0200
commitcf731d41b5fb8cb9cfbd664c010402b8e01c1f35 (patch)
tree910f5f3f86fef3c96c726f23c63e2d666668875d /pdf
parent851c6d046b61fced71fc46b43e54b7dc0ce4ef94 (diff)
Correct pagenumber: first page doesn't have a number and title page doesn't count
Diffstat (limited to 'pdf')
-rw-r--r--pdf/create.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pdf/create.go b/pdf/create.go
index 3a417f3..12b4662 100644
--- a/pdf/create.go
+++ b/pdf/create.go
@@ -31,13 +31,13 @@ func (t Tree) Render() {
switch row.Type {
case "newpage":
block = ""
+ t.PDF.AddPage()
t.PDF.SetHeaderFuncMode(func() {
ln = 0
t.PDF.SetY(0.5)
t.PDF.SetX(-1)
- t.PDF.Cell(0, 0, strconv.Itoa(t.PDF.PageNo())+".")
+ t.PDF.Cell(0, 0, strconv.Itoa(t.PDF.PageNo()-1)+".")
}, true)
- t.PDF.AddPage()
continue
case "titlepage":
block = "title"