Parameters
PDFReader also accepts the base Reader constructor parameters.
Methods
read()
Reads a PDF and returns a list of documents.
async_read()
The async variant of read(). It accepts the same parameters.Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Parameters and methods of PDFReader, which reads PDF files into documents.
| Parameter | Type | Default | Description |
|---|---|---|---|
split_on_pages | bool | True | Create one document per page instead of one document for the whole file |
page_start_numbering_format | Optional[str] | "<start page {page_nr}>" | Marker inserted at the start of each page. Set to an empty string to remove |
page_end_numbering_format | Optional[str] | "<end page {page_nr}>" | Marker inserted at the end of each page. Set to an empty string to remove |
password | Optional[str] | None | Password to unlock encrypted PDFs |
sanitize_content | bool | True | Join fragmented lines from PDF text extraction into flowing text. Disable to preserve whitespace-sensitive content like code blocks or tables |
chunking_strategy | Optional[ChunkingStrategy] | DocumentChunking() | Strategy used to chunk documents |
PDFReader also accepts the base Reader constructor parameters.
read()| Parameter | Type | Default | Description |
|---|---|---|---|
pdf | Optional[Union[str, Path, IO[Any]]] | None | Path to the PDF file or a file-like object |
name | Optional[str] | None | Name override for the resulting documents |
password | Optional[str] | None | Password to unlock the PDF. Falls back to the constructor password when not set |
async_read()read(). It accepts the same parameters.Was this page helpful?