langchain.document_loaders.pdf.PyPDFium2Loader

class langchain.document_loaders.pdf.PyPDFium2Loader(file_path: str, *, headers: Optional[Dict] = None, extract_images: bool = False)[source]

Load PDF using pypdfium2 and chunks at character level.

Initialize with a file path.

Attributes

source

Methods

__init__(file_path, *[, headers, extract_images])

Initialize with a file path.

lazy_load()

Lazy load given path as pages.

load()

Load given path as pages.

load_and_split([text_splitter])

Load Documents and split into chunks.

__init__(file_path: str, *, headers: Optional[Dict] = None, extract_images: bool = False)[source]

Initialize with a file path.

lazy_load() Iterator[Document][source]

Lazy load given path as pages.

load() List[Document][source]

Load given path as pages.

load_and_split(text_splitter: Optional[TextSplitter] = None) List[Document]

Load Documents and split into chunks. Chunks are returned as Documents.

Parameters

text_splitter – TextSplitter instance to use for splitting documents. Defaults to RecursiveCharacterTextSplitter.

Returns

List of Documents.