document

package
v0.0.0-...-cab22b1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 5 Imported by: ? 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

This section is empty.

Types

type Document

type Document interface {
	PageCount() int
	ExtractPage(pageNum int) (Page, error)
	ExtractAllPages() ([]Page, error)
	Close() error
}

type ImageFormat

type ImageFormat string
const (
	PNG  ImageFormat = "png"
	JPEG ImageFormat = "jpg"
)

func (ImageFormat) MimeType

func (f ImageFormat) MimeType() (string, error)

type ImageOptions

type ImageOptions struct {
	Format  ImageFormat
	Quality int
	DPI     int
}

func DefaultImageOptions

func DefaultImageOptions() ImageOptions

type PDFDocument

type PDFDocument struct {
	// contains filtered or unexported fields
}

func OpenPDF

func OpenPDF(path string) (*PDFDocument, error)

func (*PDFDocument) Close

func (d *PDFDocument) Close() error

func (*PDFDocument) ExtractAllPages

func (d *PDFDocument) ExtractAllPages() ([]Page, error)

func (*PDFDocument) ExtractPage

func (d *PDFDocument) ExtractPage(pageNum int) (Page, error)

func (*PDFDocument) PageCount

func (d *PDFDocument) PageCount() int

type PDFPage

type PDFPage struct {
	// contains filtered or unexported fields
}

func (*PDFPage) Number

func (p *PDFPage) Number() int

func (*PDFPage) ToImage

func (p *PDFPage) ToImage(opts ImageOptions) ([]byte, error)

type Page

type Page interface {
	Number() int
	ToImage(opts ImageOptions) ([]byte, error)
}

Jump to

Keyboard shortcuts

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