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.
func WithInterpreterConfig ¶
func WithInterpreterConfig(cfg pdf.InterpreterConfig) func(o *PDFOptions)
WithInterpreterConfig sets the interpreter config for the PDF loader.
func WithInterpreterOpts ¶
func WithInterpreterOpts(opts ...pdf.InterpreterOption) func(o *PDFOptions)
WithInterpreterOpts sets the interpreter options for the PDF loader.
Types ¶
type PDF ¶
type PDF struct {
// contains filtered or unexported fields
}
PDF represents a PDF document loader that implements the DocumentLoader interface.
func NewPDFFromFile ¶
func NewPDFFromFile(f *os.File, optFns ...func(o *PDFOptions)) (*PDF, error)
NewPDFFromFile creates a new PDF loader with the given options.
func NewPDFFromReader ¶
func NewPDFFromReader(f io.Reader, optFns ...func(o *PDFOptions)) (*PDF, error)
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 // InterpreterConfig is the configuration for the PDF interpreter. InterpreterConfig *pdf.InterpreterConfig }
Click to show internal directories.
Click to hide internal directories.