pdf2imgs
pdf2imgs(stream: str | Path | bytes) -> list[np.ndarray] | None
-
Description: Converts a PDF to a list of BGR numpy images (one per page).
-
Dependencies
- Requires system
poppler(e.g. Ubuntupoppler-utils), otherwisepdf2imagemay not work properly.
- Requires system
-
Parameters
- stream (
str | Path | bytes): PDF path or PDF bytes.
- stream (
-
Returns
- list[np.ndarray] | None: Images per page; returns
Noneon failure.
- list[np.ndarray] | None: Images per page; returns
-
Example
from capybara.vision.improc import pdf2imgs
imgs = pdf2imgs('sample.pdf')