---
title: "Extract pages from PDF on iOS | Nutrient SDK"
canonical_url: "https://www.nutrient.io/guides/ios/extraction/page-extraction/"
md_url: "https://www.nutrient.io/guides/ios/extraction/page-extraction.md"
last_updated: "2026-05-21T11:22:21.609Z"
description: "Nutrient’s Processor can extract pages from one document and put them in another document. You can choose to extract a single page, a range of pages."
---

# Extract pages from PDFs on iOS

Nutrient’s [`Processor`](https://www.nutrient.io/api/ios/documentation/pspdfkit/processor) can extract pages from one document and put them in another document. You can choose to extract a single page, a range of pages, or even multiple page ranges.

In most cases, you’ll want to use [`Processor`](https://www.nutrient.io/api/ios/documentation/pspdfkit/processor) to create a new PDF document on disk based on a current [`Document`](https://www.nutrient.io/api/ios/documentation/pspdfkit/document). The example below shows how to flatten annotations and extract the first three pages in a document to another document on disk:

### SWIFT

```swift

// Create a default configuration.
let configuration = Processor.Configuration(document: document)!
// Change all annotations to be flattened (instead of saved as annotations).
configuration.modifyAnnotations(ofTypes:.all, change:.flatten)
// Only extract pages 0, 1, and 2.
configuration.includeOnlyIndexes(IndexSet(integersIn: 0...2))

// Start the conversion from `document` to `extractedURL`.
let processor = Processor(configuration: configuration, securityOptions: nil)
// Save to a new file on disk. Alternatively, you can use `output(to:)`
// to save the resulting document to a custom data source.
try processor.write(toFileURL: extractedURL)

```

### OBJECTIVE-C

```objc

// Create a default configuration.
PSPDFProcessorConfiguration *configuration = [[PSPDFProcessorConfiguration alloc] initWithDocument:document];
// Change all annotations to be flattened (instead of saved as annotations).
[configuration modifyAnnotationsOfTypes:PSPDFAnnotationTypeAll change:PSPDFAnnotationChangeFlatten];
// Only extract pages 0, 1, and 2.
[configuration includeOnlyIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, 2)]];

// Start the conversion from `document` to `extractedURL`.
PSPDFProcessor *processor = [[PSPDFProcessor alloc] initWithConfiguration:configuration securityOptions:nil];
// Save to a new file on disk. Alternatively, you can use `outputToDataSink:error:`
// to save the resulting document to a custom data source.
[processor writeToFileURL:extractedURL error:NULL];

```

Similar functionality is also available via [Document Editor](https://www.nutrient.io/guides/ios/features/document-editor.md). See the [`PDFDocumentEditor.exportPages(_:toPath:withCompletionBlock:)`](https://www.nutrient.io/api/ios/documentation/pspdfkit/pdfdocumenteditor/exportpages(_:topath:withcompletionblock:)) API documentation for more information.
---

## Related pages

- [PDF extraction library for iOS](/guides/ios/extraction.md)
- [Extract metadata from PDFs on iOS](/guides/ios/extraction/metadata.md)
- [Extract images from PDFs on iOS](/guides/ios/extraction/image-extraction.md)
- [Parse PDF content on iOS](/guides/ios/extraction/parse-content.md)
- [Extract selected text from PDFs on iOS](/guides/ios/extraction/selected-text.md)
- [Extract text from PDFs on iOS](/guides/ios/features/text-extraction.md)
- [Extract the text position from PDFs on iOS](/guides/ios/extraction/text-position.md)

