Releases: kumaF/pyhtml2pdf
Releases · kumaF/pyhtml2pdf
pyhtml2pdf 0.1.0
⚠️ Breaking Changes
The following breaking changes have been introduced:
ghostscript_commandis now strictly validated and must be one of:["gs", "gswin64c", "gswin32c"].compressor.compressnow accepts a newmax_pdf_sizeparameter to limit the maximum allowed PDF size and prevent unexpectedly large files.compressor.compressnow accepts a newtimeoutparameter to limit Ghostscript execution time and provide protection against DoS attacks.compressor.compressnow accepts a newforce_processparameter, allowing processing to continue even when suspicious content is detected (use with caution).
🔐 Security: PDF Suspicious Content Detection
Added enhanced validation to detect potentially unsafe or malformed PDF files, including checks for:
- File size limit violations
- Invalid or corrupted PDF headers
- PDFs with no pages
- Embedded JavaScript
- Embedded files (attachments)
- Rich media annotations
- XFA forms
These safeguards help prevent the processing of malicious, unsupported, or malformed PDF content.