Documentation
¶
Overview ¶
Package pdfcpu adapts github.com/pdfcpu/pdfcpu (Apache-2.0, pure Go) to the objects.Store interface.
This is a borrowed layer, isolated so it can be replaced by a native parser without touching callers. Everything pdfcpu-specific stays inside this file: its types never appear in a signature that objects.Store exposes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(rs io.ReadSeeker) (objects.Store, error)
New reads a PDF from rs. The reader must stay valid for the lifetime of the Store: pdfcpu resolves object streams lazily and seeks back to the file.
func NewFromBytes ¶
NewFromBytes reads a PDF held in memory.
func Open ¶
Open reads the PDF at path.
The path comes from the caller by design — this is a library and CLI whose purpose is to open the file a user names. Callers that need to confine reads to a directory should resolve and check the path themselves, then use New with an *os.File, or use os.Root and pass the resulting file.
Types ¶
type Decoder ¶
Decoder is implemented by stores that can decode stream filter chains. Callers type-assert for it so the capability is discoverable without widening objects.Store, which a native parser will satisfy directly.
type ReadStats ¶
type ReadStats struct {
FileSize int64
Linearized bool
Hybrid bool
UsingObjectStreams bool
UsingXRefStreams bool
BinaryTotalSize int64
BinaryImageSize int64
BinaryFontSize int64
}
ReadStats reports what the parser observed about file structure. It is adapter-specific diagnostic detail, surfaced for `probe` rather than promoted into objects.Store, because a different parser would report different things.