From a8d8f9e6a80f014f8f5a2388fbf7f409fe9cf263 Mon Sep 17 00:00:00 2001 From: d1ngd0 Date: Wed, 12 Dec 2018 14:04:24 -0600 Subject: Added the ability to have multiple pages in a template (#216) * Added the ability to have multiple pages in a template Templates are now aware of the number of pages they have. The main additions are the FromPage and FromPages methods which allow you to extract a Template from a template if you pass in the page number. It follows the same page mechanism as FPDF where pages start in the index 1. * Update fpdf_test.go --- template.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'template.go') diff --git a/template.go b/template.go index d27bc40..1bcd25d 100644 --- a/template.go +++ b/template.go @@ -124,6 +124,9 @@ type Template interface { Bytes() []byte Images() map[string]*ImageInfoType Templates() []Template + NumPages() int + FromPage(int) (Template, error) + FromPages() []Template Serialize() ([]byte, error) gob.GobDecoder gob.GobEncoder -- cgit v1.2.1-24-ge1ad