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 ¶
ExtractText returns the text of each page in the PDF document as a slice of strings.
Click to show internal directories.
Click to hide internal directories.