pdf

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRangeTooLarge = errors.New("extracted PDF page range exceeds byte limit")
)

Functions

func ExtractRange

func ExtractRange(ctx context.Context, rs io.ReadSeeker, start, end, maxBytes int) ([]byte, error)

ExtractRange creates a PDF containing the zero-based half-open page range [start, end). A fresh source context is parsed on every call because pdfcpu's extraction mutates or shares named-destination structures between contexts.

func PageCount

func PageCount(path string) (int, error)

func PageCountContext

func PageCountContext(ctx context.Context, rs io.ReadSeeker) (int, error)

PageCountContext deliberately skips pdfcpu's full validation and optimization. Some valid-in-practice PDFs (for example, invoices with a bare /Annots Dict) are readable but rejected by the validator even in relaxed mode.

Types

This section is empty.

Jump to

Keyboard shortcuts

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