document

package
v0.0.0-...-349ac01 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: MIT Imports: 5 Imported by: 0

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