Releases: coenttb/swift-html-to-pdf
0.4.0
This release makes several key improvements to the PDF generation functionality:
- Refactor WebViewPool using Dependencies framework and a proper Swift actor
to better handle concurrency and resource sharing - Fix the task processing in PDF generation to properly run tasks concurrently
instead of waiting for each one to complete - Add proper error handling and resource cleanup in WebView operations
- Improve test reliability with better cleanup and verification
- Add documentation about WebKit process assertion warnings in README
These changes fix issues with concurrent PDF processing where tests would hang
or fail when generating multiple PDFs simultaneously. The actor-based approach
provides better isolation and safer state management for the WebView pool.
Technical details:
- Added swift-dependencies package for dependency injection
- Created WebViewPoolActor with proper isolation and continuation handling
- Fixed resource leaks by ensuring WebView release in error cases
- Added explanation for WebKit assertion warnings in non-UI contexts
Full Changelog: 0.3.0...0.4.0
0.3.0
What's Changed
- Support rendering base 64 encoded
by @jonathansds and @coenttb in #4
New Contributors
- @jonathansds made their first contribution in #4
Full Changelog: 0.2.1...0.3.0
0.2.1
Full Changelog: 0.2.0...0.2.1
0.2.0
Introducing overloads that return an AsyncSequence that yield the URL of each printed PDF. This enable asynchronous handling of each PDF’s creation, allowing immediate processing of each file’s URL as it’s generated. This is useful for tasks like uploading, logging, or further processing, enhancing efficiency and scalability when dealing with multiple PDFs.
Full Changelog: 0.1.6...0.2.0
0.1.6
Full Changelog: 0.1.5...0.1.6
0.1.5
Updated documentation.
Full Changelog: 0.1.4...0.1.5
0.1.4
Fixed: improved [Document].print to ensure it completes successfully. Tests are all passing, also repeatedly.
Full Changelog: 0.1.3...0.1.4
0.1.3
Pagination
FIX: WKWebView.createPDF(...) does not do pagination. Therefore, we fall back to NSPrintOperation for MacOS and UIPrintPageRenderer for iOS.
Known Issue:
- Tests are passing individually, but when run at the same time, they seem to hang.
Full Changelog: 0.1.2...0.1.3
0.1.2
Full Changelog: 0.1.1...0.1.2
0.1.1
What's Changed
- Update Package.swift by @finestructure in #1
New Contributors
- @finestructure made their first contribution in #1
Full Changelog: 0.1.0...0.1.1