summaryrefslogtreecommitdiff
path: root/fpdf.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.go
parent41627bb3061b250ed757f243df74918986177ec9 (diff)
Add an example for Paul Montag's page box feature
Diffstat (limited to 'fpdf.go')
-rw-r--r--fpdf.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/fpdf.go b/fpdf.go
index 43688dd..1e324b1 100644
--- a/fpdf.go
+++ b/fpdf.go
@@ -337,10 +337,11 @@ func (f *Fpdf) SetCellMargin(margin float64) {
f.cMargin = margin
}
-// SetPageBox sets the page box for the current page, and any following pages.
-// Allowable types are trim, trimbox, crop, cropbox, bleed, bleedbox, art and artbox
-// box types are case insensitive.
-func (f *Fpdf) SetPageBox(t string, pb PageBox) {
+// SetPageBoxRec sets the page box for the current page, and any following
+// pages. Allowable types are trim, trimbox, crop, cropbox, bleed, bleedbox,
+// art and artbox box types are case insensitive. See SetPageBox() for a method
+// that specifies the coordinates and extent of the page box individually.
+func (f *Fpdf) SetPageBoxRec(t string, pb PageBox) {
switch strings.ToLower(t) {
case "trim":
fallthrough
@@ -376,6 +377,13 @@ func (f *Fpdf) SetPageBox(t string, pb PageBox) {
f.defPageBoxes[t] = pb
}
+// SetPageBox sets the page box for the current page, and any following pages.
+// Allowable types are trim, trimbox, crop, cropbox, bleed, bleedbox, art and
+// artbox box types are case insensitive.
+func (f *Fpdf) SetPageBox(t string, x, y, wd, ht float64) {
+ f.SetPageBoxRec(t, PageBox{SizeType{Wd: wd, Ht: ht}, PointType{X: x, Y: y}})
+}
+
// SetFontLocation sets the location in the file system of the font and font
// definition files.
func (f *Fpdf) SetFontLocation(fontDirStr string) {