Documentation
¶
Overview ¶
Package inspect provides lightweight PDF inspection helpers.
Index ¶
- Variables
- func DecodedStreams(data []byte) ([][]byte, error)
- func DecodedStreamsContext(ctx context.Context, data []byte) ([][]byte, error)
- func FirstPageSizePoints(data []byte) (float64, float64, error)
- func PageCount(data []byte) (int, error)
- func PageCountContext(ctx context.Context, data []byte) (int, error)
- func PageText(data []byte, pageNum int) (string, error)
- func PageTextContext(ctx context.Context, data []byte, pageNum int) (string, error)
- func Text(data []byte) (string, error)
- func TextContext(ctx context.Context, data []byte) (string, error)
- func ValidateStructure(data []byte) error
- func ValidateStructureContext(ctx context.Context, data []byte) error
Constants ¶
This section is empty.
Variables ¶
var ErrTextLimitExceeded = errors.New("pdf text extraction limit exceeded")
ErrTextLimitExceeded reports that PDF text extraction exceeded a bounded operand, nesting, token, or output limit.
Functions ¶
func DecodedStreams ¶
DecodedStreams returns raw or Flate-decoded PDF streams in file order.
func DecodedStreamsContext ¶
DecodedStreamsContext returns raw or Flate-decoded PDF streams in file order and honors ctx while scanning and decoding streams.
func FirstPageSizePoints ¶
FirstPageSizePoints returns the first MediaBox dimensions in PDF points.
func PageCountContext ¶
PageCountContext returns the number of pages PDFRune can parse from data and honors ctx while importing the page tree.
func PageTextContext ¶
PageTextContext extracts text from one importable PDF page while honoring ctx.
func TextContext ¶
TextContext extracts literal text operators from page content streams and honors ctx during page parsing and text tokenization. Non-page streams such as metadata, fonts, images, and attachments are not treated as document text.
func ValidateStructure ¶
ValidateStructure checks that data can be parsed as an unencrypted classic PDF with at least one importable page.
Types ¶
This section is empty.