summaryrefslogtreecommitdiff
path: root/fpdf.go
diff options
context:
space:
mode:
authorKurt Jung <kurt.w.jung@gmail.com>2015-10-10 15:24:43 -0400
committerKurt Jung <kurt.w.jung@gmail.com>2015-10-10 15:24:43 -0400
commit92858a8b5ff04e4196597d9d517f3b2a0d651579 (patch)
tree4697ba0ba2019cd48d29ad462da280bd18aa6e36 /fpdf.go
parent5847afd8a205853a7effbf749b7a388ae325eb24 (diff)
Conditionally sort image catalog. Correct small typos.
Diffstat (limited to 'fpdf.go')
-rw-r--r--fpdf.go20
1 files changed, 14 insertions, 6 deletions
diff --git a/fpdf.go b/fpdf.go
index aeb0c3e..b5ed8e6 100644
--- a/fpdf.go
+++ b/fpdf.go
@@ -3140,7 +3140,6 @@ func (f *Fpdf) putfonts() {
sort.Strings(fileList)
}
for _, file = range fileList {
- // for file, info := range f.fontFiles {
info = f.fontFiles[file]
// Font file embedding
f.newobj()
@@ -3352,9 +3351,20 @@ func (f *Fpdf) putimage(info *ImageInfoType) {
}
func (f *Fpdf) putxobjectdict() {
- for _, image := range f.images {
- // foreach($this->images as $image)
- f.outf("/I%d %d 0 R", image.i, image.n)
+ {
+ var image *ImageInfoType
+ var key string
+ var keyList []string
+ for key = range f.images {
+ keyList = append(keyList, key)
+ }
+ if f.catalogSort {
+ sort.Strings(keyList)
+ }
+ for _, key = range keyList {
+ image = f.images[key]
+ f.outf("/I%d %d 0 R", image.i, image.n)
+ }
}
for _, tpl := range f.templates {
id := tpl.ID()
@@ -3379,8 +3389,6 @@ func (f *Fpdf) putresourcedict() {
}
for _, key = range keyList {
font = f.fonts[key]
- // for _, font := range f.fonts {
- // foreach($this->fonts as $font)
f.outf("/F%d %d 0 R", font.I, font.N)
}
}