diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2021-12-09 13:19:41 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2021-12-09 14:07:15 +0100 |
commit | d0f80aa6ae5d02a2e55850c58b2871c1662cb7e1 (patch) | |
tree | 8ba46fa880a4c8d43bec565f91a980eed6742c91 | |
parent | 97ffe3d46ebc71097bbb83c738e39cf8fd64e9c8 (diff) | |
download | pdf-simple-sign-d0f80aa6ae5d02a2e55850c58b2871c1662cb7e1.tar.gz pdf-simple-sign-d0f80aa6ae5d02a2e55850c58b2871c1662cb7e1.tar.xz pdf-simple-sign-d0f80aa6ae5d02a2e55850c58b2871c1662cb7e1.zip |
Go: enable listing all indirect objects
-rw-r--r-- | pdf/pdf.go | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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 { |