MCPcopy Index your code
hub / github.com/mindee/doctr / from_pdf

Method from_pdf

doctr/io/reader.py:25–38  ·  view source on GitHub ↗

Read a PDF file >>> from doctr.io import DocumentFile >>> doc = DocumentFile.from_pdf("path/to/your/doc.pdf") Args: file: the path to the PDF file or a binary stream **kwargs: additional parameters to :meth:`pypdfium2.PdfPage.render` Returns

(cls, file: AbstractFile, **kwargs)

Source from the content-addressed store, hash-verified

23
24 @classmethod
25 def from_pdf(cls, file: AbstractFile, **kwargs) -> list[np.ndarray]:
26 """Read a PDF file
27
28 >>> from doctr.io import DocumentFile
29 >>> doc = DocumentFile.from_pdf("path/to/your/doc.pdf")
30
31 Args:
32 file: the path to the PDF file or a binary stream
33 **kwargs: additional parameters to :meth:`pypdfium2.PdfPage.render`
34
35 Returns:
36 the list of pages decoded as numpy ndarray of shape H x W x 3
37 """
38 return read_pdf(file, **kwargs)
39
40 @classmethod
41 def from_url(cls, url: str, **kwargs) -> list[np.ndarray]:

Callers 11

mainFunction · 0.80
_process_fileFunction · 0.80
test_extract_cropsFunction · 0.80
test_extract_rcropsFunction · 0.80
test_document_fileFunction · 0.80
test_pdfFunction · 0.80
test_ocrpredictorFunction · 0.80
test_kiepredictorFunction · 0.80
get_documentsFunction · 0.80
mainFunction · 0.80
from_urlMethod · 0.80

Calls 1

read_pdfFunction · 0.85

Tested by 6

test_extract_cropsFunction · 0.64
test_extract_rcropsFunction · 0.64
test_document_fileFunction · 0.64
test_pdfFunction · 0.64
test_ocrpredictorFunction · 0.64
test_kiepredictorFunction · 0.64