---
title: "Add page to PDF file on iOS | Nutrient SDK"
canonical_url: "https://www.nutrient.io/guides/ios/editor/add-page/"
md_url: "https://www.nutrient.io/guides/ios/editor/add-page.md"
last_updated: "2026-05-30T02:20:01.309Z"
description: "With Nutrient, there are three ways to add a page to a document:."
---

# Add pages to PDF files on iOS

With Nutrient, there are three ways to add a page to a document:

1. Add a blank page programmatically

2. Take a page from a different document and insert it as a new page programmatically

3. Interactively with the user interface

## Adding a blank page

You can add a blank page to a document using the [`.blank` template document](https://www.nutrient.io/guides/ios/miscellaneous/custom-page-templates/). This is how it looks in code:

### SWIFT

```swift

// Create a default configuration.
let processorConfiguration = Processor.Configuration(document: firstDocument)!
// Create a blank page template.
let pageTemplate = PageTemplate(pageType:.emptyPage, identifier:.blank)
// Create a new page configuration.
let pageConfiguration = PDFNewPageConfiguration(pageTemplate: pageTemplate, builderBlock: nil)
// Add the first page from the second document as the second page (index 1) of the resulting merged document.
processorConfiguration.addNewPage(at: 1, configuration: PDFNewPageConfiguration(pageTemplate: pageTemplate, builderBlock: nil))
// Initialize the processor.
let processor = Processor(configuration: configuration, securityOptions: nil)
// Write the merged document to disk. Alternatively, you can use `output(to:)`
// to save the resulting document to a custom data source.
try processor.write(toFileURL: mergedDocumentURL)
// Use the merged document.
let mergedDocument = Document(url: mergedDocumentURL)

```

### OBJECTIVE-C

```objc

// Create a default configuration.
PSPDFProcessorConfiguration *processorConfiguration = [[PSPDFProcessorConfiguration alloc] initWithDocument:firstDocument];
// Create a blank page template.
PSPDFPageTemplate *pageTemplate = [[PSPDFPageTemplate alloc] initWithPageType:PSPDFNewPageTypeEmptyPage identifier:PSPDFTemplateIdentifierBlank];
// Create a new page configuration.
PSPDFNewPageConfiguration *pageConfiguration = [PSPDFNewPageConfiguration newPageConfigurationWithPageTemplate:pageTemplate builderBlock:NULL];
// Add the first page from the second document as the second page (index 1) of the resulting merged document.
[processorConfiguration addNewPageAtIndex:1 configuration:pageConfiguration];
// Initialize the processor.
PSPDFProcessor *processor = [[PSPDFProcessor alloc] initWithConfiguration:processorConfiguration securityOptions:nil];
// Write the merged document to disk. Alternatively, you can use `outputToDataSink:error:`
// to save the resulting document to a custom data source.
[processor writeToFileURL:mergedDocumentURL error:NULL];
// Use the merged document.
PSPDFDocument *mergedDocument = [[PSPDFDocument alloc] initWithURL:mergedDocumentURL];

```

## Inserting a page from another document

If you’re looking to merge or add specific pages from one document to another, you can use [`Processor.Configuration.addNewPage(at:configuration:)`](https://www.nutrient.io/api/ios/documentation/pspdfkit/processor/configuration/addnewpage(at:configuration:)). The example below inserts the first page from the second document as the second page of the resulting merged document:

### SWIFT

```swift

// Create a default configuration.
let processorConfiguration = Processor.Configuration(document: firstDocument)!
// Create a page template with the first page of the second document.
let pageTemplate = PageTemplate(document: secondDocument, sourcePageIndex: 0)
// Create a new page configuration.
let pageConfiguration = PDFNewPageConfiguration(pageTemplate: pageTemplate, builderBlock: nil)
// Add the first page from the second document as the second page (index 1) of the resulting merged document.
processorConfiguration.addNewPage(at: 1, configuration: PDFNewPageConfiguration(pageTemplate: pageTemplate, builderBlock: nil))
// Initialize the processor.
let processor = Processor(configuration: configuration, securityOptions: nil)
// Write the merged document to disk. Alternatively, you can use `output(to:)`
// to save the resulting document to a custom data source.
try processor.write(toFileURL: mergedDocumentURL)
// Use the merged document.
let mergedDocument = Document(url: mergedDocumentURL)

```

### OBJECTIVE-C

```objc

// Create a default configuration.
PSPDFProcessorConfiguration *processorConfiguration = [[PSPDFProcessorConfiguration alloc] initWithDocument:firstDocument];
// Create a page template with the first page of the second document.
PSPDFPageTemplate *pageTemplate = [[PSPDFPageTemplate alloc] initWithDocument:secondDocument sourcePageIndex:0];
// Create a new page configuration.
PSPDFNewPageConfiguration *pageConfiguration = [PSPDFNewPageConfiguration newPageConfigurationWithPageTemplate:pageTemplate builderBlock:NULL];
// Add the first page from the second document as the second page (index 1) of the resulting merged document.
[processorConfiguration addNewPageAtIndex:1 configuration:pageConfiguration];
// Initialize the processor.
PSPDFProcessor *processor = [[PSPDFProcessor alloc] initWithConfiguration:processorConfiguration securityOptions:nil];
// Write the merged document to disk. Alternatively, you can use `outputToDataSink:error:`
// to save the resulting document to a custom data source.
[processor writeToFileURL:mergedDocumentURL error:NULL];
// Use the merged document.
PSPDFDocument *mergedDocument = [[PSPDFDocument alloc] initWithURL:mergedDocumentURL];

```



## Using the user interface

The Document Editor component offers a [convenient UI](https://www.nutrient.io/guides/ios/features/document-editor-ui.md) for inserting blank pages or pages with predefined patterns into existing documents — this is perfect for adding new pages for more scratch space for drawing or adding textual notes.
---

## Related pages

- [Add and insert images into PDFs on iOS](/guides/ios/editor/add-image.md)
- [How to attach files to PDFs on iOS](/guides/ios/editor/attach-a-file.md)
- [Customizing PDF editing permissions on iOS](/guides/ios/editor/document-permissions.md)
- [iOS PDF editor API usage](/guides/ios/features/document-editor.md)
- [PDF editor library for iOS](/guides/ios/features/document-processing.md)
- [Split PDFs on iOS](/guides/ios/editor/split.md)
- [Edit text in PDFs on iOS](/guides/ios/editor/edit-text.md)
- [Merge multiple PDF files on iOS](/guides/ios/editor/merge-or-combine.md)
- [Adding watermarks to PDFs on iOS](/guides/ios/editor/watermark.md)

