swift-html-to-pdf 1.0.0
π swift-html-to-pdf 1.0.0
Production-ready HTML to PDF generation for Swift with exceptional performance.
β‘ Performance
- 1,939 PDFs/sec (continuous mode)
- 677 PDFs/sec (paginated mode)
- 35 MB constant memory (4-24 concurrent workers)
- Zero memory leaks - tested with 1M+ PDFs
β¨ What's New
Complete rewrite built on Swift 6 strict concurrency and Dependencies pattern:
- 5x performance improvement over 0.x
- Constant memory usage regardless of concurrency level
- Simpler API - One dependency property, accessible everywhere
- Full Sendable guarantees - Zero data races possible
- WebView resource pooling - Pre-warmed instances with automatic lifecycle management
- Streaming results - Process PDFs as they're generated
- Production metrics - Built-in swift-metrics integration
- Comprehensive documentation - 2,492 lines of DocC guides
π¦ Installation
dependencies: [
.package(url: "https://github.com/coenttb/swift-html-to-pdf.git", from: "1.0.0")
]Optional: Enable type-safe HTML DSL
.package(
url: "https://github.com/coenttb/swift-html-to-pdf.git",
from: "1.0.0",
traits: ["HTML"]
)π Documentation
π§ͺ Testing
- 102 test functions across 23 test suites
- Stress-tested with 1M PDFs
- Zero OOM errors in production
β οΈ Breaking Changes
This is a complete rewrite. Migration from 0.x required. Expected migration time: <10 minutes for projects using dependency injection patterns.
π Requirements
- Swift 6.0+
- macOS 14.0+ or iOS 17.0+
- Xcode 16.0+