summaryrefslogtreecommitdiff
path: root/fpdf.go
diff options
context:
space:
mode:
authorPaul Montag <pmontag@iseeme.com>2018-12-14 11:34:00 -0600
committerPaul Montag <pmontag@iseeme.com>2018-12-17 08:32:16 -0600
commitc27eea9fd19b65f75c4326c12446e829b39ab66d (patch)
treeb29dd73fd266a9199fb4107ee78bde91340f8353 /fpdf.go
parenta8d8f9e6a80f014f8f5a2388fbf7f409fe9cf263 (diff)
Refactored Encode and Decode functions, Fixed Template ID Conflicts
- Updated Encode and Decode to ensure templates and images are pointers to the original objects - Refactored so encoding no longer has to create p and o labels for images - removed id from template and generate it using Bytes instead.
Diffstat (limited to 'fpdf.go')
-rw-r--r--fpdf.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/fpdf.go b/fpdf.go
index 99c087e..46fe007 100644
--- a/fpdf.go
+++ b/fpdf.go
@@ -83,8 +83,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.templates = make(map[string]Template)
+ f.templateObjects = make(map[string]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)
@@ -3559,8 +3559,8 @@ func (f *Fpdf) putxobjectdict() {
}
}
{
- var keyList []int64
- var key int64
+ var keyList []string
+ var key string
var tpl Template
keyList = templateKeyList(f.templates, f.catalogSort)
for _, key = range keyList {
@@ -3568,7 +3568,7 @@ func (f *Fpdf) putxobjectdict() {
// for _, tpl := range f.templates {
id := tpl.ID()
if objID, ok := f.templateObjects[id]; ok {
- f.outf("/TPL%d %d 0 R", id, objID)
+ f.outf("/TPL%s %d 0 R", id, objID)
}
}
}