Versions in this module Expand all Collapse all v0 v0.2.2 Sep 23, 2026 Changes in this version + var ErrCannotReadFile = errors.New("reader: cannot read file") + var ErrEncryptedUnsupported = errors.New("reader: encrypted PDFs are not supported") + var ErrPageOutOfRange = errors.New("reader: page index out of range") + var ErrUnsupportedPDF = errors.New("reader: unsupported PDF") + type Box struct + X1 float64 + X2 float64 + Y1 float64 + Y2 float64 + func (b Box) Height() float64 + func (b Box) IsZero() bool + func (b Box) Width() float64 + type Modifier struct + func ExtractPages(r *PdfReader, pageIndexes ...int) (*Modifier, error) + func Merge(readers ...*PdfReader) (*Modifier, error) + func MergeFiles(paths ...string) (*Modifier, error) + func RedactPattern(r *PdfReader, pattern *regexp.Regexp, opts *RedactOptions) (*Modifier, error) + func RedactText(r *PdfReader, targets []string, opts *RedactOptions) (*Modifier, error) + func (m *Modifier) AddBlankPage(width, height float64) error + func (m *Modifier) Bytes() []byte + func (m *Modifier) CropPage(index int, rect [4]float64) error + func (m *Modifier) PageCount() int + func (m *Modifier) RemovePage(index int) error + func (m *Modifier) ReorderPages(order []int) error + func (m *Modifier) RotatePage(index, degrees int) error + func (m *Modifier) SaveTo(path string) error + type PageInfo struct + ArtBox Box + BleedBox Box + CropBox Box + Height float64 + MediaBox Box + Number int + Rotate int + TrimBox Box + Width float64 + func (p *PageInfo) ContentStream() ([]byte, error) + func (p *PageInfo) ExtractText() (string, error) + func (p *PageInfo) VisibleBox() Box + type PdfReader struct + func Load(path string) (*PdfReader, error) + func Parse(data []byte) (*PdfReader, error) + func ParseWithOptions(data []byte, opts ReadOptions) (*PdfReader, error) + func (r *PdfReader) Page(index int) (*PageInfo, error) + func (r *PdfReader) PageCount() int + func (r *PdfReader) RawBytes() []byte + func (r *PdfReader) Version() string + type ReadOptions struct + Strictness Strictness + type RedactOptions struct + FillColor [3]float64 + OverlayColor [3]float64 + OverlayFontSize float64 + OverlayText string + StripMetadata bool + type Strictness int + const StrictnessStrict + const StrictnessTolerant