summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fpdf_test.go23
-rw-r--r--pdf/reference/Fpdf_UnderlineThickness.pdfbin0 -> 1156 bytes
2 files changed, 23 insertions, 0 deletions
diff --git a/fpdf_test.go b/fpdf_test.go
index c6020f3..43cea30 100644
--- a/fpdf_test.go
+++ b/fpdf_test.go
@@ -2688,3 +2688,26 @@ func ExampleFpdf_RoundedRect() {
// Output:
// Successfully generated pdf/Fpdf_RoundedRect.pdf
}
+
+// ExampleFpdf_SetUnderlineThickness demonstrates how to adjust the text
+// underline thickness.
+func ExampleFpdf_SetUnderlineThickness() {
+ pdf := gofpdf.New("P", "mm", "A4", "") // 210mm x 297mm
+ pdf.AddPage()
+ pdf.SetFont("Arial", "U", 12)
+
+ pdf.SetUnderlineThickness(0.5)
+ pdf.CellFormat(0, 10, "Thin underline", "", 1, "", false, 0, "")
+
+ pdf.SetUnderlineThickness(1)
+ pdf.CellFormat(0, 10, "Normal underline", "", 1, "", false, 0, "")
+
+ pdf.SetUnderlineThickness(2)
+ pdf.CellFormat(0, 10, "Thicker underline", "", 1, "", false, 0, "")
+
+ fileStr := example.Filename("Fpdf_UnderlineThickness")
+ err := pdf.OutputFileAndClose(fileStr)
+ example.Summary(err, fileStr)
+ // Output:
+ // Successfully generated pdf/Fpdf_UnderlineThickness.pdf
+}
diff --git a/pdf/reference/Fpdf_UnderlineThickness.pdf b/pdf/reference/Fpdf_UnderlineThickness.pdf
new file mode 100644
index 0000000..49ad9b1
--- /dev/null
+++ b/pdf/reference/Fpdf_UnderlineThickness.pdf
Binary files differ