diff options
author | Kurt <kurt.w.jung@gmail.com> | 2018-04-15 14:15:23 -0400 |
---|---|---|
committer | Kurt <kurt.w.jung@gmail.com> | 2018-04-15 14:15:23 -0400 |
commit | 892fe1b63b9a9f0b7bcdcdcdeb96cb6fe0d0a2bb (patch) | |
tree | a36ff2b45416a5e96172e015135ad624a805c07d /fpdf_test.go | |
parent | f2f3e9500092af921abde270a026e8ceb2098ec4 (diff) |
Add SetHeaderFuncMode() method to automatically set position to left and top margin after header function is called. Backward compatibility is preserved. This addresses issue #174.
Diffstat (limited to 'fpdf_test.go')
-rw-r--r-- | fpdf_test.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fpdf_test.go b/fpdf_test.go index bbeb5b0..9f0ee96 100644 --- a/fpdf_test.go +++ b/fpdf_test.go @@ -206,14 +206,15 @@ func Example() { // This example demonsrates the generation of headers, footers and page breaks. func ExampleFpdf_AddPage() { pdf := gofpdf.New("P", "mm", "A4", "") - pdf.SetHeaderFunc(func() { + pdf.SetTopMargin(30) + pdf.SetHeaderFuncMode(func() { pdf.Image(example.ImageFile("logo.png"), 10, 6, 30, 0, false, "", 0, "") pdf.SetY(5) pdf.SetFont("Arial", "B", 15) pdf.Cell(80, 0, "") pdf.CellFormat(30, 10, "Title", "1", 0, "C", false, 0, "") pdf.Ln(20) - }) + }, true) pdf.SetFooterFunc(func() { pdf.SetY(-15) pdf.SetFont("Arial", "I", 8) |