summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoop Kiefte <ikojba@gmail.com>2020-11-23 17:23:39 +0200
committerJoop Kiefte <ikojba@gmail.com>2020-11-23 17:23:39 +0200
commit1e07880757bf8818c711f7563b5939b58d55cf0f (patch)
tree7a2aa265e1c0e6ac0fe09b1663ff27ba05df070a
parent3cc73f6de64f1e216683a74adb8736001bca3a0b (diff)
Change linecount mechanism to purely spacing -- now it's exactly 55 lines and the counter is gone
-rw-r--r--pdf/create.go9
1 files changed, 1 insertions, 8 deletions
diff --git a/pdf/create.go b/pdf/create.go
index 7b1c47d..639b78c 100644
--- a/pdf/create.go
+++ b/pdf/create.go
@@ -27,7 +27,6 @@ func pagenumber() {
func (t Tree) Render() {
var block string
- var ln int
var lastsection int
for _, row := range t.F {
switch row.Type {
@@ -35,7 +34,6 @@ func (t Tree) Render() {
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()-1)+".")
@@ -73,18 +71,13 @@ func (t Tree) Render() {
row.Type = block
}
t.pr(row.Type, row.Contents)
- ln++
- if ln == 55 {
- t.PDF.AddPage()
- ln = 0
- }
}
}
func line(pdf *gofpdf.Fpdf, format rules.Format, text string) {
pdf.SetFont(format.Font, format.Style, format.Size)
pdf.SetX(format.Left)
- pdf.MultiCell(format.Width, 0.16, text, "", format.Align, false)
+ pdf.MultiCell(format.Width, 0.165, text, "", format.Align, false)
// TODO: create liner to do away with multicell and add inline markup support
}