From d0d72167eb9b66b73f3ec1b84b7911a5bf97fb00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Tue, 14 May 2024 15:10:27 +0200 Subject: [PATCH] v0.0.454 --- goextVersion.go | 4 ++-- wpdf/wpdf.go | 24 +++++++++++++++--------- wpdf/wpdfCell.go | 2 +- wpdf/wpdfMultiCell.go | 2 +- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/goextVersion.go b/goextVersion.go index 759b738..62112e6 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -1,5 +1,5 @@ package goext -const GoextVersion = "0.0.453" +const GoextVersion = "0.0.454" -const GoextVersionTimestamp = "2024-05-14T14:57:10+0200" +const GoextVersionTimestamp = "2024-05-14T15:10:27+0200" diff --git a/wpdf/wpdf.go b/wpdf/wpdf.go index 1d0d0ff..e214f48 100644 --- a/wpdf/wpdf.go +++ b/wpdf/wpdf.go @@ -6,12 +6,13 @@ import ( ) type WPDFBuilder struct { - b *gofpdf.Fpdf - tr func(string) string - cellHeight float64 - fontName PDFFontFamily - fontStyle PDFFontStyle - fontSize float64 + b *gofpdf.Fpdf + tr func(string) string + cellHeight float64 + cellSpacing float64 + fontName PDFFontFamily + fontStyle PDFFontStyle + fontSize float64 } type PDFMargins struct { @@ -38,9 +39,10 @@ func NewPDFBuilder(orientation PDFOrientation, size PDFSize, unicode bool) *WPDF } b := &WPDFBuilder{ - b: fpdfbuilder, - tr: tr, - cellHeight: 5, + b: fpdfbuilder, + tr: tr, + cellHeight: 5, + cellSpacing: 1, } b.SetMargins(PDFMargins{Left: 15, Top: 25, Right: 15}) // default values @@ -103,6 +105,10 @@ func (b *WPDFBuilder) SetFont(fontName PDFFontFamily, fontStyle PDFFontStyle, fo b.cellHeight = b.b.PointConvert(fontSize) } +func (b *WPDFBuilder) SetCellSpacing(h float64) { + b.cellSpacing = h +} + func (b *WPDFBuilder) Ln(h float64) { b.b.Ln(h) } diff --git a/wpdf/wpdfCell.go b/wpdf/wpdfCell.go index 1de34da..59bd3d4 100644 --- a/wpdf/wpdfCell.go +++ b/wpdf/wpdfCell.go @@ -115,7 +115,7 @@ func (b *WPDFBuilder) Cell(txt string, opts ...*PDFCellOpt) { txtTR := b.tr(txt) width := float64(0) - height := b.cellHeight + height := b.cellHeight + b.cellSpacing border := BorderNone ln := BreakToNextLine align := AlignLeft diff --git a/wpdf/wpdfMultiCell.go b/wpdf/wpdfMultiCell.go index 428704f..92749c0 100644 --- a/wpdf/wpdfMultiCell.go +++ b/wpdf/wpdfMultiCell.go @@ -91,7 +91,7 @@ func (b *WPDFBuilder) MultiCell(txt string, opts ...*PDFMultiCellOpt) { txtTR := b.tr(txt) width := float64(0) - height := b.cellHeight + height := b.cellHeight + b.cellSpacing border := BorderNone align := AlignLeft fill := false