summaryrefslogtreecommitdiff
path: root/fpdf_test.go
diff options
context:
space:
mode:
authorKurt <kurt.w.jung@gmail.com>2018-11-10 14:21:54 -0500
committerKurt <kurt.w.jung@gmail.com>2018-11-10 14:21:54 -0500
commit412d885ded2ae0364f78168e8e88c9451c61d32b (patch)
tree5f7f77500b9fedcc31f41283db86353a17a905dc /fpdf_test.go
parent41627bb3061b250ed757f243df74918986177ec9 (diff)
Add an example for Paul Montag's page box feature
Diffstat (limited to 'fpdf_test.go')
-rw-r--r--fpdf_test.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/fpdf_test.go b/fpdf_test.go
index 62bae17..0e947ed 100644
--- a/fpdf_test.go
+++ b/fpdf_test.go
@@ -2194,10 +2194,6 @@ func ExampleNewGrid() {
// Successfully generated pdf/Fpdf_Grid.pdf
}
-func pagebox(pdf *gofpdf.Fpdf, boxstr string, x, y, wd, ht float64) {
- pdf.SetPageBox(boxstr, gofpdf.PageBox{gofpdf.SizeType{Wd: wd, Ht: ht}, gofpdf.PointType{X: x, Y: y}})
-}
-
// This example demonstrates the use of a page box
func ExamplePageBox() {
// pdfinfo (from http://www.xpdfreader.com) reports the following for this example:
@@ -2224,7 +2220,7 @@ func ExamplePageBox() {
boxmargin = 3 * fontsize
)
pdf := gofpdf.New("P", "mm", "A4", "") // 210mm x 297mm
- pagebox(pdf, "crop", boxmargin, boxmargin, wd-2*boxmargin, ht-2*boxmargin)
+ pdf.SetPageBox("crop", boxmargin, boxmargin, wd-2*boxmargin, ht-2*boxmargin)
pdf.SetFont("Arial", "", pdf.UnitToPointConvert(fontsize))
pdf.AddPage()
pdf.MoveTo(fontsize, fontsize)