extractor

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2025 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Worker

func Worker(id int, jobs <-chan Job, errors chan<- JobErr, done chan<- struct{}, wg *sync.WaitGroup)

Worker process page extraction

Types

type Job

type Job struct {
	Page    Page
	PageNum int
}

Job contains data about Page processed and current page number

type JobErr

type JobErr struct {
	Err      error
	WorkerID int
}

JobErr stores error for workerID if occurs

type Page

type Page struct {
	Doc        *fitz.Document
	ImgType    string
	SavePath   string
	Prefix     string
	Postfix    string
	ScaleDown  float64
	SizeX      int
	SizeY      int
	Thumbnails Thumbnail
}

Page contains settings for page extraction as image and pointer to source doc

func (*Page) Extract

func (ps *Page) Extract(pageNum int) error

Extract page from pdf document as image

type Thumbnail

type Thumbnail struct {
	IsActive  bool
	ScaleDown float64
	SizeX     int
	SizeY     int
}

Thumbnail contains settings for thimbnails

Jump to

Keyboard shortcuts

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