summaryrefslogtreecommitdiff
path: root/fpdf_test.go
diff options
context:
space:
mode:
authorKurt <kurt.w.jung@gmail.com>2019-09-07 09:34:11 -0400
committerKurt <kurt.w.jung@gmail.com>2019-09-07 09:34:11 -0400
commit55163912400e026280068ffb69bef8b0b3c42778 (patch)
treef467ebd1ea382a4030e49c656d5f9aaa9d1f8dd1 /fpdf_test.go
parent225d875579b542d345946a136d24f8add53b4dc3 (diff)
parent5d0bba740b8c3f5619d5a39b724f4d59e99fe4b4 (diff)
Merge branch 'strikeout' of https://github.com/Rjinswand/gofpdf into Rjinswand-strikeout
Diffstat (limited to 'fpdf_test.go')
-rw-r--r--fpdf_test.go26
1 files changed, 22 insertions, 4 deletions
diff --git a/fpdf_test.go b/fpdf_test.go
index 43cea30..267bc6c 100644
--- a/fpdf_test.go
+++ b/fpdf_test.go
@@ -20,6 +20,9 @@ import (
"bufio"
"bytes"
"fmt"
+ "gofpdf"
+ "gofpdf/internal/example"
+ "gofpdf/internal/files"
"io"
"io/ioutil"
"math"
@@ -31,10 +34,6 @@ import (
"strings"
"testing"
"time"
-
- "github.com/jung-kurt/gofpdf"
- "github.com/jung-kurt/gofpdf/internal/example"
- "github.com/jung-kurt/gofpdf/internal/files"
)
func init() {
@@ -2711,3 +2710,22 @@ func ExampleFpdf_SetUnderlineThickness() {
// Output:
// Successfully generated pdf/Fpdf_UnderlineThickness.pdf
}
+
+// ExampleFpdf_strikeout demonstrates striked-out text
+func ExampleFpdf_strikeout() {
+
+ pdf := gofpdf.New("P", "mm", "A4", "") // 210mm x 297mm
+ pdf.AddPage()
+
+ for fontSize := 4; fontSize < 40; fontSize += 10 {
+ pdf.SetFont("Arial", "S", float64(fontSize))
+ pdf.SetXY(0, float64(fontSize))
+ pdf.Cell(40, 10, "Hello World\n")
+ }
+
+ fileStr := example.Filename("Fpdf_strikeout")
+ err := pdf.OutputFileAndClose(fileStr)
+ example.Summary(err, fileStr)
+ // Output:
+ // Successfully generated pdf/Fpdf_strikeout.pdf
+}