Nutrient iOS SDK
Need pricing or implementation help? Talk to Sales.
PDF EDITING IN SWIFT
import PSPDFKit
// Extract pages 0–4 into a separate document.let configuration = Processor.Configuration(document: sourceDocument)!configuration.includeOnlyIndexes(IndexSet(0..<5))
let processor = Processor(configuration: configuration, securityOptions: nil)try processor.write(toFileURL: outputURL)import PSPDFKit
// Merge two PDFs into a single document.let mergedDoc = Document(dataProviders: [ FileDataProvider(fileURL: firstDocURL), FileDataProvider(fileURL: secondDocURL)])
let configuration = Processor.Configuration(document: mergedDoc)!let processor = Processor(configuration: configuration, securityOptions: nil)try processor.write(toFileURL: outputURL)import PSPDFKit
// Rotate pages 0 and 1 clockwise by 90 degrees.let configuration = Processor.Configuration(document: document)!configuration.rotatePages(IndexSet([0, 1]), rotation: 90)
let processor = Processor(configuration: configuration, securityOptions: nil)try processor.write(toFileURL: outputURL)USE CASES
Users need to reorganize, trim, or combine PDFs directly on device. The SDK covers the full range of page operations — split, merge, reorder, remove — with both programmatic and built-in UI options.
Rotate scanned pages to correct orientation, crop oversized margins, or scale pages to a standard size before processing. The Processor API handles these transforms in batch without user interaction.
Add text or image watermarks to PDFs before sharing or exporting. Apply them across all pages or selectively, programmatically, or through the document editor.
Set document permissions to control what recipients can do — restrict printing, copying, editing, or form filling. Permissions are embedded in the PDF and enforced by compliant readers.
Extract page ranges from a document into separate files, or combine multiple PDFs into one. Both operations use the Processor API and write the result to a new file.
Rotate, crop, scale, move, copy, and remove pages. Operations are available through the Processor API for automation or the Document Editor API for building interactive UIs.
Insert blank pages, pages from other documents, or pages via the interactive UI. Apply watermarks across all pages or targeted pages before export.
Read and write document metadata — title, author, subject, and keywords. Set document permissions to control what viewers can do with a file.
ADVANCED CAPABILITIES
The SDK provides two distinct APIs for document editing. The Processor API is designed for automated, non-interactive operations — ideal for background processing, pipelines, and batch jobs. The Document Editor API is designed for building general-purpose interactive UIs where users manipulate pages directly.
Apply page operations — rotate, crop, scale, split, merge — as part of automated workflows. Results are written to a new file without presenting any UI.
Build a general-purpose document editor where users drag, reorder, rotate, and delete pages. The Document Editor handles state and UI interaction.
Use the included document editor view controller for common page operations out of the box. Customize it or replace it entirely with your own UI.
Page manipulation operations (crop, scale, move, copy) require the Document Editor component to be enabled in your license.
Use Processor.Configuration initialized with your source document. Then call includeOnlyIndexes() with the page range you want to extract. Instantiate a Processor and write the result to a new file URL. Repeat with different index sets to split into multiple documents. See the split guide for a complete example.
Initialize a Document with multiple data providers — one per source file. Pass that document to Processor.Configuration and write the result. The Processor combines all source pages into a single output document. See the merge guide for the full implementation.
Create a Processor.Configuration from your document, and call rotatePages(_:rotation:) with the page index set and rotation angle (multiples of 90 degrees). Then write the result with a Processor. You can also rotate pages through the built-in document editor UI or the Document Editor API. See the rotate guide.
Use Processor.Configuration and call the page removal method with an IndexSet of the pages to remove. A single Processor operation can remove multiple pages at once. Removal is also available through the built-in document editor UI for interactive use cases. See the remove pages guide.
The SDK supports three approaches: add a blank page programmatically using a blank page template, insert a page sourced from a different document, or let users add pages interactively through the built-in UI. The Processor and Document Editor APIs both support page insertion. See the add page guide.
Watermarks are applied through the Processor API. Configure the watermark properties in your Processor.Configuration, and then write the output. See the watermark guide for implementation details.
Document permissions control what a recipient can do with a PDF: printing, copying, editing, form filling. Set permissions via the SDK’s document permissions API before saving. The permissions are embedded in the PDF and enforced by compliant PDF readers. See the document permissions guide.
The Processor API is for automated, non-interactive document operations. It takes a configuration, applies the specified transforms (rotate, crop, split, merge, etc.), and writes the result to a new file. The Document Editor API is for building interactive UIs — it manages document state and supports live editing where users drag, reorder, and delete pages. Some operations (crop, scale, move, copy) require the Document Editor component in your license.
FREE TRIAL
Add PDF editing to your iOS app in minutes — split, merge, rotate, and manipulate pages with no payment information required.