You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add add_page method for inserting blank pages into PDFs (#11)
* Add add_page method for inserting blank pages into PDFs
Implements issue #10 by adding the add_page method to the DirectAPIMixin.
This method allows users to insert blank pages at specified positions
within PDF documents using the Nutrient DWS Build API.
Features:
- Insert blank pages at any position (beginning, middle, end)
- Configurable page count, size, and orientation
- Support for various page sizes (A4, Letter, Legal, A3, A5)
- Portrait and landscape orientations
- Standard file input/output handling with optional output_path
Implementation follows established patterns from existing methods like
duplicate_pdf_pages and delete_pdf_pages, using the NewPagePart schema
from the OpenAPI specification.
Includes comprehensive integration tests covering all functionality:
- Basic page addition
- Multiple page insertion
- Beginning/end positioning
- Custom page sizes and orientations
- File output handling
- Error cases for invalid parameters
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Fix add_page method logic for inserting at end of document
- Improve logic for handling page insertion positions
- Update documentation to clarify end insertion approach
- Fix test to use valid page index instead of arbitrary large number
- Restructure parts building logic for better clarity
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Fix formatting and page index in test
- Remove trailing whitespace and fix formatting
- Correct page index in test to avoid API error (use page 4 instead of 5)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
---------
Co-authored-by: Claude <[email protected]>
0 commit comments