From 412d885ded2ae0364f78168e8e88c9451c61d32b Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 10 Nov 2018 14:21:54 -0500 Subject: Add an example for Paul Montag's page box feature --- fpdf_test.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'fpdf_test.go') 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) -- cgit v1.2.1-24-ge1ad