pdfinspect

package
v2026.1201.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: MIT Imports: 30 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Annotate

func Annotate(ctx context.Context, path, output string, annotation Annotation) (int, error)

func EditPages

func EditPages(ctx context.Context, output string, sources []PageSource, deletePages []int) (int, error)

Types

type Annotation

type Annotation struct {
	Page int       `json:"page"`
	Kind string    `json:"kind"`
	Rect []float32 `json:"rect"`
	Text string    `json:"text,omitempty"`
}

type ExtractedImage

type ExtractedImage struct {
	Path  string `json:"path"`
	Page  int    `json:"page"`
	Bytes int64  `json:"size_bytes"`
}

func ExtractImages

func ExtractImages(ctx context.Context, source, destination string, first, last int) ([]ExtractedImage, error)

type Page

type Page struct {
	Number       int                   `json:"number"`
	WidthPoints  float64               `json:"width_points"`
	HeightPoints float64               `json:"height_points"`
	Rotation     int                   `json:"rotation"`
	Boxes        map[string][4]float64 `json:"boxes,omitempty"`
	Images       *int                  `json:"image_entries,omitempty"`
}

type PageSource

type PageSource struct {
	Path  string `json:"path"`
	Pages []int  `json:"pages"`
}

type PageText

type PageText struct {
	Number  int    `json:"page"`
	Text    string `json:"text"`
	HasText bool   `json:"has_text"`
	Image   bool   `json:"image_attached,omitempty"`
}

func ReadPages

func ReadPages(ctx context.Context, path string, first, last int, includeImage bool) ([]PageText, [][]byte, bool, error)

type Report

type Report struct {
	FontEntriesInRange *int              `json:"font_entries_in_range,omitempty"`
	Status             string            `json:"status"`
	Bytes              int               `json:"bytes"`
	SHA256             string            `json:"sha256"`
	PageCount          int               `json:"page_count,omitempty"`
	Properties         map[string]string `json:"properties"`
	Indicators         map[string]int    `json:"indicators"`
	RawNameHints       map[string]int    `json:"raw_name_hints"`
	Pages              []Page            `json:"pages,omitempty"`
	Issues             []string          `json:"issues,omitempty"`
}

func Analyze

func Analyze(ctx context.Context, path string, pageLimit int) (Report, error)

type SearchHit

type SearchHit struct {
	Page          int     `json:"page"`
	FirstSentence int     `json:"first_sentence"`
	LastSentence  int     `json:"last_sentence"`
	Text          string  `json:"text"`
	Score         float64 `json:"score"`
	Truncated     bool    `json:"truncated,omitempty"`
}

type SearchResult

type SearchResult struct {
	Pages         int         `json:"pages"`
	PagesWithText int         `json:"pages_with_text"`
	ParserWarning bool        `json:"parser_warning,omitempty"`
	Hits          []SearchHit `json:"hits"`
}
func Search(ctx context.Context, path, query string, limit int, fuzzy bool) (SearchResult, error)

Jump to

Keyboard shortcuts

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