From 2f30e325ebd2734d95b129e214f168b24928ee0a Mon Sep 17 00:00:00 2001 From: Adrian-George Bostan Date: Mon, 24 Sep 2018 18:25:05 +0300 Subject: [PATCH] Add Reset method for the StyledParagraph component --- pdf/creator/styled_paragraph.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pdf/creator/styled_paragraph.go b/pdf/creator/styled_paragraph.go index 6da44da5..3c4bb77c 100644 --- a/pdf/creator/styled_paragraph.go +++ b/pdf/creator/styled_paragraph.go @@ -104,6 +104,11 @@ func (p *StyledParagraph) Append(text string, style TextStyle) { p.wrapText() } +func (p *StyledParagraph) Reset(text string, style TextStyle) { + p.chunks = []TextChunk{} + p.Append(text, style) +} + // SetTextAlignment sets the horizontal alignment of the text within the space provided. func (p *StyledParagraph) SetTextAlignment(align TextAlignment) { p.alignment = align