pdf_utils
pdf_split_pages(input_pdf)
¶
Splits a PDF into individual pages in a temporary directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input_pdf
|
Union[BytesIO, BinaryIO]
|
Input PDF file in bytes or binary mode |
required |
max_workers
|
Maximum number of concurrent workers for parallel processing |
required |
Returns:
Type | Description |
---|---|
Tuple[List[Path], TemporaryDirectory[Any]]
|
Tuple containing: - List of paths to individual PDF pages - Temporary directory object (caller must call cleanup()) |
Example
paths, tmp_dir = split_pdf_temp("input.pdf")
Use paths...¶
tmp_dir.cleanup() # Clean up temp files when done