Skip to content

swift-html-to-pdf 1.0.0

Choose a tag to compare

@coenttb coenttb released this 08 Oct 06:22

πŸš€ 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+