aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-12-09 13:19:41 +0100
committerPřemysl Eric Janouch <p@janouch.name>2021-12-09 14:07:15 +0100
commitd0f80aa6ae5d02a2e55850c58b2871c1662cb7e1 (patch)
tree8ba46fa880a4c8d43bec565f91a980eed6742c91
parent97ffe3d46ebc71097bbb83c738e39cf8fd64e9c8 (diff)
downloadpdf-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.go11
1 files changed, 11 insertions, 0 deletions
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 {