pdfextract

package
v2.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PDFBackend

type PDFBackend interface {
	// ExtractText extracts text from the PDF file, returning a slice where each element is a page's text.
	ExtractText(ctx context.Context, filePath string) ([]string, error)
	// Close releases any resources associated with the backend.
	Close() error
}

PDFBackend is the interface for extracting text from PDF files.

type PDFiumBackend

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

PDFiumBackend implements PDFBackend using go-pdfium via WASM.

func NewPDFiumBackend

func NewPDFiumBackend(poolSize int) (*PDFiumBackend, error)

NewPDFiumBackend initializes a new PDFium WebAssembly backend. poolSize sizes the WASM instance pool to the number of concurrent workers that will extract PDFs. GetInstanceWithContext blocks until an instance is free, so a pool smaller than the worker count would serialize extraction and time out under load.

func (*PDFiumBackend) Close

func (b *PDFiumBackend) Close() error

Close releases the PDFium instance and pool.

func (*PDFiumBackend) ExtractText

func (b *PDFiumBackend) ExtractText(ctx context.Context, filePath string) ([]string, error)

ExtractText returns the text of each page in the PDF document as a slice of strings.

Jump to

Keyboard shortcuts

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