Class ReadDocumentsFromInMemoryPdfChain
java.lang.Object
com.github.hakenadu.javalangchains.chains.data.reader.ReadDocumentsFromPdfChainBase<ReadDocumentsFromInMemoryPdfChain.InMemoryPdf>
com.github.hakenadu.javalangchains.chains.data.reader.ReadDocumentsFromInMemoryPdfChain
- All Implemented Interfaces:
Chain<ReadDocumentsFromInMemoryPdfChain.InMemoryPdf,Stream<Map<String,String>>>
public class ReadDocumentsFromInMemoryPdfChain extends ReadDocumentsFromPdfChainBase<ReadDocumentsFromInMemoryPdfChain.InMemoryPdf>
Utilizes Apache PDFBox to read documents from a byte array
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classReadDocumentsFromInMemoryPdfChain.InMemoryPdfwrapper for an in memory pdf (byte array + title)Nested classes/interfaces inherited from class com.github.hakenadu.javalangchains.chains.data.reader.ReadDocumentsFromPdfChainBase
ReadDocumentsFromPdfChainBase.PdDocumentWrapper, ReadDocumentsFromPdfChainBase.PdfReadMode -
Constructor Summary
Constructors Constructor Description ReadDocumentsFromInMemoryPdfChain()creates aReadDocumentsFromInMemoryPdfChainwhich reads the whole pdf as a documentReadDocumentsFromInMemoryPdfChain(ReadDocumentsFromPdfChainBase.PdfReadMode readMode)creates aReadDocumentsFromInMemoryPdfChainReadDocumentsFromInMemoryPdfChain(ReadDocumentsFromPdfChainBase.PdfReadMode readMode, boolean parallel)creates aReadDocumentsFromInMemoryPdfChain -
Method Summary
Modifier and Type Method Description protected Stream<ReadDocumentsFromPdfChainBase.PdDocumentWrapper>loadPdDocuments(ReadDocumentsFromInMemoryPdfChain.InMemoryPdf input)load a pdf from an input instanceMethods inherited from class com.github.hakenadu.javalangchains.chains.data.reader.ReadDocumentsFromPdfChainBase
run
-
Constructor Details
-
ReadDocumentsFromInMemoryPdfChain
public ReadDocumentsFromInMemoryPdfChain(ReadDocumentsFromPdfChainBase.PdfReadMode readMode, boolean parallel)creates aReadDocumentsFromInMemoryPdfChain- Parameters:
readMode-ReadDocumentsFromPdfChainBase.readModeparallel-ReadDocumentsFromPdfChainBase.parallel
-
ReadDocumentsFromInMemoryPdfChain
creates aReadDocumentsFromInMemoryPdfChain- Parameters:
readMode-ReadDocumentsFromPdfChainBase.readMode
-
ReadDocumentsFromInMemoryPdfChain
public ReadDocumentsFromInMemoryPdfChain()creates aReadDocumentsFromInMemoryPdfChainwhich reads the whole pdf as a document
-
-
Method Details
-
loadPdDocuments
protected Stream<ReadDocumentsFromPdfChainBase.PdDocumentWrapper> loadPdDocuments(ReadDocumentsFromInMemoryPdfChain.InMemoryPdf input) throws IOExceptionDescription copied from class:ReadDocumentsFromPdfChainBaseload a pdf from an input instance- Specified by:
loadPdDocumentsin classReadDocumentsFromPdfChainBase<ReadDocumentsFromInMemoryPdfChain.InMemoryPdf>- Parameters:
input- input instance- Returns:
PDDocument- Throws:
IOException- on error loading pdf
-