Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithConfig ¶
func WithConfig(config PDFOptions) func(o *PDFOptions)
WithConfig sets the PDF loader configuration.
Types ¶
type PDF ¶
type PDF struct {
// contains filtered or unexported fields
}
PDF represents a PDF document loader that implements the DocumentLoader interface.
func NewPDF ¶
func NewPDF(r io.Reader, optFns ...func(o *PDFOptions)) (*PDF, error)
NewPDFFromFile creates a new PDF loader with the given options.
func (*PDF) Load ¶
Load loads the PDF document and returns a slice of vs.Document containing the page contents and metadata.
func (*PDF) LoadAndSplit ¶
LoadAndSplit loads PDF documents from the provided reader and splits them using the specified text splitter.
type PDFOptions ¶
type PDFOptions struct {
// Password for encrypted PDF files.
Password string
// Page number to start loading from (default is 1).
StartPage uint
// Maximum number of pages to load (0 for all pages).
MaxPages uint
// Source is the name of the pdf document
Source string
// Number of goroutines to load pdf documents
NumThread int
}
Click to show internal directories.
Click to hide internal directories.