What's Changed
This release adds significant new functionality with 13 new Direct API methods and numerous stability improvements.
✨ New Features
Direct API Methods
create_redactions_preset()
- Create redactions using predefined patterns (SSN, email, phone, etc.)create_redactions_regex()
- Create redactions using custom regex patternscreate_redactions_text()
- Create redactions for specific text stringsoptimize_pdf()
- Optimize PDF file size and performancepassword_protect_pdf()
- Add password protection to PDFsset_pdf_metadata()
- Update PDF metadata (title, author)split_pdf()
- Split PDFs into multiple files based on page rangesduplicate_pdf_pages()
- Duplicate specific pages within a PDFdelete_pdf_pages()
- Remove specific pages from a PDFadd_page()
- Insert blank pages at specific positionsapply_instant_json()
- Apply PSPDFKit Instant JSON annotationsapply_xfdf()
- Apply XFDF annotations to PDFsset_page_label()
- Set custom page labels (Roman numerals, letters, etc.)
Enhancements
- 🖼️ Image file support for
watermark_pdf()
method - now accepts PNG/JPEG images as watermarks - 🧪 Improved CI/CD integration test strategy with better error reporting
- 📈 Enhanced test coverage for all new Direct API methods
🐛 Bug Fixes
- Critical API compatibility issues in Direct API integration
- Python 3.9 and 3.10 syntax compatibility across the codebase
- Comprehensive CI failure resolution
- Integration test fixes to match actual API behavior patterns
- Ruff linting and formatting issues throughout the project
- MyPy type checking errors and improved type annotations
- Removed unsupported parameters from API calls
- Fixed page range handling in split_pdf with proper defaults
- Resolved runtime errors with isinstance union syntax
- Updated test fixtures to use valid PNG images
📋 Requirements
- Python 3.10+ (maintained as per project design)
- requests>=2.25.0,<3.0.0
📦 Installation
pip install nutrient-dws==1.0.2
📚 Documentation
See the README for usage examples of the new features.
Full Changelog: v1.0.1...v1.0.2