| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.md | 2026-01-14 | 2.4 kB | |
| v1.0.8 source code.tar.gz | 2026-01-14 | 14.7 MB | |
| v1.0.8 source code.zip | 2026-01-14 | 14.7 MB | |
| Totals: 3 Items | 29.4 MB | 0 | |
This release brings enhanced error handling flexibility, improved OCR text quality, and important security fixes.
What's Changed
Features
-
Enhanced Error Handling: The
ignore_pdf_errorsandignore_ocr_errorsparameters now accept custom checker functions in addition to boolean flags, enabling more granular control over error suppression in https://github.com/oomol-lab/pdf-craft/pull/323 -
Improved OCR Text Quality: Implemented n-gram detection to automatically filter out repetitive character sequences that indicate neural text degradation in https://github.com/oomol-lab/pdf-craft/pull/330
Security
- Security Fix: Upgraded
pypdffrom^6.4.1to^6.6.0to address CVE-2026-22691 vulnerability in https://github.com/oomol-lab/pdf-craft/pull/329 - Fixes issue where malicious PDFs could cause long-running processes when processing invalid startxref entries
- Resolves https://github.com/oomol-lab/pdf-craft/issues/328
Other
- Code formatting improvements in https://github.com/oomol-lab/pdf-craft/pull/331
- README image link update by @alwaysmavs in https://github.com/oomol-lab/pdf-craft/pull/324
Example Usage
Custom Error Handling with Functions
:::python
from pdf_craft import transform_markdown, OCRError
def should_ignore_ocr_error(error: OCRError) -> bool:
# Only ignore specific types of OCR errors
return error.kind == "recognition_failed"
transform_markdown(
pdf_path="input.pdf",
markdown_path="output.md",
ignore_ocr_errors=should_ignore_ocr_error, # Pass custom function
)
Traditional Boolean Error Handling (Still Supported)
:::python
from pdf_craft import transform_markdown
transform_markdown(
pdf_path="input.pdf",
markdown_path="output.md",
ignore_ocr_errors=True, # Simple boolean flag
)
API Changes
The following parameters have been enhanced to accept both boolean values and callable functions:
ignore_pdf_errors:bool | Callable[[PDFError], bool]ignore_ocr_errors:bool | Callable[[OCRError], bool]
This change is fully backward compatible - existing code using boolean values will continue to work without modifications.
Full Changelog: https://github.com/oomol-lab/pdf-craft/compare/v1.0.7...v1.0.8