langchain.document_loaders.pdf.PyMuPDFLoader

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

Load PDF files using PyMuPDF.

Initialize with a file path.

Attributes

source

Methods

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

Initialize with a file path.

lazy_load()

A lazy loader for Documents.

load(**kwargs)

Load file.

load_and_split([text_splitter])

Load Documents and split into chunks.

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

Initialize with a file path.

lazy_load() Iterator[Document]

A lazy loader for Documents.

load(**kwargs: Any) List[Document][source]

Load file.

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.