From c2f1dc847b48af2fce23fda68ad574c28dbbdad6 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Thu, 26 Jan 2017 22:51:45 +1100 Subject: [PATCH] fixed byObject sort order --- pdf/writer.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pdf/writer.go b/pdf/writer.go index 6fd560c5..88c5d3f4 100644 --- a/pdf/writer.go +++ b/pdf/writer.go @@ -101,7 +101,8 @@ func (this *PdfWriter) Show() { } } -// byObject sorts slices of PdfObject by "Type" and "Subtype" keys. See ObjStreamType +// byObject sorts slices of PdfObject by "Type" and "Subtype" key if they are PdfObjectStream +// or PdfObjectDictionary then by if whether are dfObjectStream or PdfObjectDictionary. type byObject []PdfObject func (x byObject) Len() int { return len(x) } @@ -122,7 +123,7 @@ func (x byObject) Less(i, j int) bool { return si } if di != dj { - return si + return di } return false }