From 32e9acfa776e7474a83f171c63a6859e2e363efe Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Sun, 4 Feb 2024 05:17:26 +0100 Subject: Go: enable multiple updates in a sequence This is not something anyone should do, but let's do things correctly. --- pdf/pdf.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pdf') diff --git a/pdf/pdf.go b/pdf/pdf.go index f6dda31..1fcdaa4 100644 --- a/pdf/pdf.go +++ b/pdf/pdf.go @@ -1271,6 +1271,9 @@ func (u *Updater) FlushUpdates() { fmt.Fprintf(buf, "\nstartxref\n%d\n%%%%EOF\n", startXref) u.Document = buf.Bytes() + u.updated = make(map[uint]struct{}) + + u.Trailer["Prev"] = NewNumeric(float64(startXref)) } // ----------------------------------------------------------------------------- -- cgit v1.2.3-70-g09d2