diff options
author | Kurt Jung <kurt.w.jung@gmail.com> | 2015-08-12 16:12:43 -0400 |
---|---|---|
committer | Kurt Jung <kurt.w.jung@gmail.com> | 2015-08-12 16:12:43 -0400 |
commit | 0ab52d3f38a38a63fe1bba1a757fe4f28cd6a026 (patch) | |
tree | b3e1222cdc4f7aca41b3ac39b4e2168ac77ee36e /fpdf.go | |
parent | 798fdbd15806d1b27a36d47f394cb58b06a9af1e (diff) | |
parent | 3c7e84a50bb3a1b617b6820d23ba2edcadf4fd6c (diff) |
Merge branch 'templating' of https://github.com/marcusatbang/gofpdf into marcusatbang-templating
Diffstat (limited to 'fpdf.go')
-rw-r--r-- | fpdf.go | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -72,6 +72,8 @@ func fpdfNew(orientationStr, unitStr, sizeStr, fontDirStr string, size SizeType) f.fonts = make(map[string]fontDefType) f.fontFiles = make(map[string]fontFileType) f.diffs = make([]string, 0, 8) + f.templates = make(map[int64]Template) + f.templateObjects = make(map[int64]int) f.images = make(map[string]*ImageInfoType) f.pageLinks = make([][]linkType, 0, 8) f.pageLinks = append(f.pageLinks, make([]linkType, 0, 0)) // pageLinks[0] is unused (1-based) @@ -3223,6 +3225,12 @@ func (f *Fpdf) putxobjectdict() { // foreach($this->images as $image) f.outf("/I%d %d 0 R", image.i, image.n) } + for _, tpl := range f.templates { + id := tpl.ID() + if objID, ok := f.templateObjects[id]; ok { + f.outf("/TPL%d %d 0 R", id, objID) + } + } } func (f *Fpdf) putresourcedict() { @@ -3305,6 +3313,7 @@ func (f *Fpdf) putresources() { return } f.putimages() + f.putTemplates() // Resource dictionary f.offsets[2] = f.buffer.Len() f.out("2 0 obj") |