xref

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindStartXRef

func FindStartXRef(r io.ReaderAt, size int64) (int64, error)

Types

type Resolver

type Resolver interface {
	Resolve(ctx context.Context, r io.ReaderAt) (Table, error)
	Trailer() *raw.DictObj
	Trailers() []*raw.DictObj
	Linearized() bool
	Incremental() []Table
}

Resolver locates and parses xref information in a PDF.

func NewResolver

func NewResolver(cfg ResolverConfig) Resolver

NewResolver returns an xref resolver that follows Prev chains and understands xref streams.

type ResolverConfig

type ResolverConfig struct {
	MaxXRefDepth int
	Recovery     recovery.Strategy
}

type Table

type Table interface {
	Lookup(objNum int) (offset int64, gen int, found bool)
	ObjStream(objNum int) (streamObj int, index int, ok bool)
	Objects() []int
	Type() string
}

Table holds object offsets for classic and stream xref data.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL