From d0f80aa6ae5d02a2e55850c58b2871c1662cb7e1 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Thu, 9 Dec 2021 13:19:41 +0100 Subject: Go: enable listing all indirect objects --- pdf/pdf.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pdf/pdf.go b/pdf/pdf.go index 120c238..075e34c 100644 --- a/pdf/pdf.go +++ b/pdf/pdf.go @@ -503,6 +503,17 @@ type Updater struct { Trailer map[string]Object } +// ListIndirect returns the whole cross-reference table as Reference Objects. +func (u *Updater) ListIndirect() []Object { + result := []Object{} + for i := 0; i < len(u.xref); i++ { + if u.xref[i].nonfree { + result = append(result, NewReference(uint(i), u.xref[i].generation)) + } + } + return result +} + func (u *Updater) parseStream(lex *Lexer, stack *[]Object) (Object, error) { lenStack := len(*stack) if lenStack < 1 { -- cgit v1.2.3-70-g09d2