diff options
author | Kurt <kurt.w.jung@gmail.com> | 2019-02-28 08:35:13 -0500 |
---|---|---|
committer | Kurt <kurt.w.jung@gmail.com> | 2019-02-28 08:35:13 -0500 |
commit | a640ab8bad3c434166bb6358a3664a89d959ccb1 (patch) | |
tree | 262bd2c84a5f6ef64904fe1e7532961aa373bfa4 /fpdf.go | |
parent | 567bef933d5649777a8b39772ad57dc9ddaba8d8 (diff) | |
parent | ac77cdcbc1c0005351dbea42cc07add42e1d3f7c (diff) |
Merge branch 'ykamo001-master'
Diffstat (limited to 'fpdf.go')
-rw-r--r-- | fpdf.go | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -383,6 +383,12 @@ func (f *Fpdf) SetPageBoxRec(t string, pb PageBox) { 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}}) } +// SetPage sets the current page to that of a valid page in the PDF document. +func (f *Fpdf) SetPage(pageNum int) { + if (pageNum > 0) && (pageNum < len(f.pages)) { + f.page = pageNum + } +} // SetFontLocation sets the location in the file system of the font and font // definition files. @@ -670,6 +676,9 @@ func (f *Fpdf) AddPageFormat(orientationStr string, size SizeType) { if f.err != nil { return } + if f.page != len(f.pages)-1 { + f.page = len(f.pages)-1 + } if f.state == 0 { f.open() } @@ -684,6 +693,7 @@ func (f *Fpdf) AddPageFormat(orientationStr string, size SizeType) { fc := f.color.fill tc := f.color.text cf := f.colorFlag + if f.page > 0 { f.inFooter = true // Page footer avoid double call on footer. |