diff options
author | Lawrence Kesteloot (lk <Lawrence Kesteloot (lk@headcode.com)> | 2014-07-21 22:44:11 -0700 |
---|---|---|
committer | Lawrence Kesteloot (lk <Lawrence Kesteloot (lk@headcode.com)> | 2014-07-21 22:44:11 -0700 |
commit | 7b79f51bb56464bcabcd82a31b8ea75c74677689 (patch) | |
tree | 738e4c58c901a84a36f0020d2e6068c9c54945c3 | |
parent | 544558bbfab23c6131b62f17cef4dbf494f4c953 (diff) |
Add GetMargins() and GetPageSize() methods.
-rw-r--r-- | fpdf.go | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -245,6 +245,26 @@ func (f *Fpdf) Error() error { return f.err } +// Return the current page's width and height. This is the paper's size. To +// compute the size of the area being used, subtract the margins (see +// GetMargins()). +func (f *Fpdf) GetPageSize() (width, height float64) { + width = f.w + height = f.h + return +} + +// Return the left, top, right, and bottom margins. The first three are set +// with the SetMargins() method. The bottom margin is set with the +// SetAutoPageBreak() method. +func (f *Fpdf) GetMargins() (left, top, right, bottom float64) { + left = f.lMargin + top = f.tMargin + right = f.rMargin + bottom = f.bMargin + return +} + // SetMargins defines the left, top and right margins. By default, they equal 1 // cm. Call this method to change them. If the value of the right margin is // less than zero, it is set to the same as the left margin. |