Enterprise PDF for Swift · iOS & macOS
The enterprise PDF library
Swift doesn't have.
Generate archival PDF/A, sign documents with PAdES, encrypt with AES-256 and produce accessible PDF/UA from Swift, on iOS and macOS. One memory-safe core, the same behavior as every other binding, running on-device or on your servers: no per-document SaaS fees, no data leaving the device, no AGPL strings.
Add via SwiftPM. Download the package from the docs, then depend on it by path. Links a static xcframework, so it works inside an iOS app bundle..package(path: "path/to/RustPdf") // download from rustpdf.dev/docs/swiftWhy Swift teams pick rust-pdf
Apple's PDFKit renders and annotates, but it does not produce PDF/A, qualified PAdES signatures or PDF/UA, the things regulated iOS and macOS apps need for contracts, statements and e-invoices. The fallback is a per-document cloud service, which means shipping user documents off the device.
rust-pdf links a static xcframework through SwiftPM, so it works inside an
iOS app bundle with nothing to dlopen. The same core runs in
server-side Swift, and a single offline license unlocks the corporate
features.
- On-device, fully offline: documents never leave the device, perfect for privacy-sensitive apps.
- iOS & macOS: a static xcframework links into an app bundle, no sidecar library to ship.
- Standards-grade: real PDF/A, PAdES and PDF/UA, beyond what PDFKit can do.
- No AGPL trap: a commercial per-application license, never the AGPL of iText or the per-server billing of Aspose.
- Free to build with: everyday PDF generation is free forever; you only license the regulated-grade features.
Free to build with. Licensed when you ship.
Prototype and generate everyday PDFs for free. When you need archival, signatures, encryption or accessibility, one license unlocks them all in Swift and every other binding.
Community free
- Pages & vector graphics
- Embedded/subset fonts, Unicode shaping
- Justified paragraphs & tables
- Images (JPEG/PNG/alpha/16-bit)
- Merge / split / rotate
- Text extraction & optimize
Corporate licensed
- PDF/A: 1b / 2b / 2a / 3b / 3a / 4 / 4e / 4f archival
- Digital signatures: PKCS#7, visible & multiple
- PAdES: B-B / B-LT / B-LTA + RFC 3161 timestamps
- Encryption: RC4 / AES-128 / AES-256 (R6)
- Accessibility: Tagged PDF / PDF/UA-1
- AcroForm: fields with generated appearances
Try every licensed feature free for 5 days.
Get a trial token by email and unlock PDF/A, digital signatures, encryption and accessibility in Swift. No account, no card required.
Author a tagged PDF/A in a few lines of Swift
// SwiftPM: download the package from rustpdf.dev/docs/swift, then .package(path: "path/to/RustPdf")
import RustPdf
let doc = try Document()
try doc.pdfa(.a2a).tagged().setInfo(DocumentInfo(title: "Q3 Report"))
let f = try doc.addFont(path: "Roboto-Regular.ttf")
try doc.addPage()
try doc.showText(font: f, size: 26, x: 72, y: 760, "Annual report", headingLevel: 1)
let bytes = try doc.toBytes() // archival-grade PDF, links on macOS & iOS
The full Swift reference (fonts, images, forms, manipulation, encryption and signatures) lives in the Swift docs.
On-device apps and server-side Swift
toBytes() returns [UInt8], which becomes a
Data for a SwiftUI ShareLink, a
UIActivityViewController, a Quick Look preview, or a write to
the app sandbox. Because the engine is fully offline, a privacy-sensitive
iOS app can produce a signed PDF/A contract without the document ever
leaving the device.
The same package compiles for server-side Swift, so a Vapor or Hummingbird
route can return the bytes as an application/pdf response. SwiftPM
links a static xcframework, so it works inside an app bundle with nothing to
dlopen and no sidecar library to ship.
// SwiftUI: build a PDF/A and share it
import RustPdf
func makeInvoice() throws -> Data {
let doc = try Document()
try doc.pdfa(.a2b)
let f = try doc.addFont(path: "Roboto-Regular.ttf")
try doc.addPage()
try doc.showText(font: f, size: 18, x: 72, y: 760, "Invoice #1024")
return Data(try doc.toBytes()) // hand to ShareLink / write to disk
}
Where to go next in Swift
The Swift reference covers the full API, and the concept hubs explain each standard in depth, with the same behavior you get on every other binding.
- Swift docs: fonts, images, forms, manipulation, encryption and signing.
- PDF/A archival and PDF/UA accessibility, explained.
- PAdES signatures (B-B / B-LT / B-LTA) and how LTV works offline.
- Encrypt a PDF and the AES-256 key derivation.
Start building in Swift
Add the SwiftPM package and ship your first archival PDF today, on iOS or macOS. Free for everyday generation; license the corporate features when you go to production.
Swift PDF library FAQ
Does it work inside an iOS app bundle?
Yes. SwiftPM links a static xcframework, so the engine is compiled into your app binary. There is no dlopen of an arbitrary path (which iOS forbids) and no sidecar dynamic library to ship in the bundle.
How is this different from Apple's PDFKit?
PDFKit renders, annotates and displays PDFs, but it does not produce PDF/A archives, qualified PAdES signatures or tagged PDF/UA. rust-pdf focuses on exactly those standards-grade outputs, and you can still hand the resulting bytes to PDFKit for on-screen preview.
Can I run it in server-side Swift?
Yes. The same package builds for macOS and Linux server targets, so a Vapor or Hummingbird service can generate, sign and encrypt documents and return the bytes as an application/pdf response, fully offline.