filter

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package filter implements the PDF stream filters needed for read-only inspection of document structure: FlateDecode (with predictors), LZW, ASCII85, ASCIIHex, RunLength.

Image-only filters (DCTDecode, JBIG2Decode, JPXDecode, CCITTFaxDecode) are intentionally not implemented — pdfdisassembler does not decode image streams.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(name string, in []byte, p Params) ([]byte, error)

Decode applies the named filter to in.

func IsImageFilter

func IsImageFilter(name string) bool

IsImageFilter reports whether name designates one of the image-only filters that pdfdisassembler intentionally skips.

Types

type ErrUnsupported

type ErrUnsupported struct{ Name string }

ErrUnsupported is returned for filters this package does not implement.

func (ErrUnsupported) Error

func (e ErrUnsupported) Error() string

type Params

type Params struct {
	// FlateDecode/LZWDecode predictor parameters.
	Predictor        int
	Columns          int
	Colors           int
	BitsPerComponent int
	// LZWDecode early-change flag.
	EarlyChange int
	// MaxOutput caps decoded bytes per filter; <= 0 means unlimited.
	MaxOutput int64
}

Params describes the decode-time parameters for a single filter.

Jump to

Keyboard shortcuts

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