Documentation
¶
Overview ¶
CRC: crc-Parser.md
CRC: crc-Filter.md | Seq: seq-open.md, seq-salvage.md
CRC: crc-Parser.md
CRC: crc-Parser.md
CRC: crc-Parser.md | Seq: seq-open.md, seq-salvage.md
CRC: crc-Parser.md
CRC: crc-Parser.md
Index ¶
- Variables
- func Decode(filters []Name, params []Dict, encoded []byte) ([]byte, error)
- func DecodeStream(s Stream) ([]byte, error)
- func IntValue(o Object) (int64, bool)
- func ReadContent(src []byte, visit func(ContentOp) error) error
- type Array
- type Bool
- type ContentOp
- type Dict
- type Document
- type Integer
- type Name
- type Null
- type Object
- type Real
- type Ref
- type Stream
- type String
Constants ¶
This section is empty.
Variables ¶
var ErrEncrypted = errors.New("parser: encrypted PDFs are not supported")
ErrEncrypted is returned when the PDF carries an /Encrypt entry. pdftext refuses encrypted PDFs without attempting decryption.
Functions ¶
func DecodeStream ¶
DecodeStream decodes a Stream using the filter chain declared in its dictionary. Applies /Filter (may be a single Name or an Array) with /DecodeParms (matching single Dict or Array) in order.
Types ¶
type ContentOp ¶
ContentOp is one PDF content-stream instruction: a list of operand objects followed by an operator name.
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
Document is a parsed PDF's object graph with lazy indirect-reference resolution.
func Parse ¶
Parse reads a PDF from r into a Document. Handles traditional xref, cross-reference streams, incremental updates, and lenient recovery for malformed xref tables. Returns ErrEncrypted if the PDF is encrypted (plaintext store-out policy; see spec R9).
func (*Document) Deref ¶
Deref resolves an Object that may be a Ref into a concrete object. Non-Ref objects pass through unchanged.
func (*Document) Resolve ¶
Resolve looks up an indirect reference and returns the target object. Returns Null{} for unknown objects (the PDF spec permits this and some malformed files rely on it).
type Object ¶
type Object interface {
// contains filtered or unexported methods
}
Object is any PDF value. All concrete object types implement it.