---
title: "Generate blank PDF on iOS | Nutrient SDK"
canonical_url: "https://www.nutrient.io/guides/ios/features/document-creation/"
md_url: "https://www.nutrient.io/guides/ios/features/document-creation.md"
last_updated: "2026-05-25T18:42:17.771Z"
description: "Nutrient iOS SDK can create a blank PDF document in a couple of different ways."
---

# Generate blank PDFs on iOS

Nutrient iOS SDK can create a blank PDF document in a couple of different ways.

This feature requires the Document Editor component to be enabled in your license.

Create a new [`PDFNewPageConfiguration`](https://www.nutrient.io/api/ios/documentation/pspdfkit/pdfnewpageconfiguration) object with a blank [`PageTemplate`](https://www.nutrient.io/api/ios/documentation/pspdfkit/pagetemplate). Use the [`PageTemplate.blank`](https://www.nutrient.io/api/ios/documentation/pspdfkit/pagetemplate/blank) convenience initializer to simplify the code. The builder block of [`PDFNewPageConfiguration`](https://www.nutrient.io/api/ios/documentation/pspdfkit/pdfnewpageconfiguration)’s initializer enables you to customize various properties of the page, such as the background color or page size:

```swift

// Create a configuration for an empty A4 size page with a white background color.
let newPageConfiguration = PDFNewPageConfiguration(pageTemplate: PageTemplate.blank) {
    $0.backgroundColor = UIColor.white
    $0.pageSize = CGSize(width: 595, height: 842) // A4 in points.
}

```

There are two ways to create the PDF document from `newPageConfiguration`: using the [Document Editor](https://www.nutrient.io/guides/ios/features/document-processing.md), or using [`Processor`](https://www.nutrient.io/api/ios/documentation/pspdfkit/processor). Both of them are explained in detail below.

## Using Document Editor

[Document Editor](https://www.nutrient.io/guides/ios/features/document-processing.md) is a Nutrient component comprised of a set of MVC classes. It provides you and your users with a whole host of page editing features, including new page creation, page duplication, copying and pasting, reordering, rotation, deletion, and the creation of new documents from a subset of selected pages.

To create an empty PDF, initialize [`PDFDocumentEditor`](https://www.nutrient.io/api/ios/documentation/pspdfkit/pdfdocumenteditor) without a [`PDFViewController`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfviewcontroller). You can then use the regular [`PDFDocumentEditor`](https://www.nutrient.io/api/ios/documentation/pspdfkit/pdfdocumenteditor) API to add pages. When done, save the new document to a location on the file system:

```swift

guard let documentEditor = PDFDocumentEditor(document: nil) else { return }
documentEditor.addPages(in: NSRange(location: 0, length: 1), with: newPageConfiguration)

// Save to a new PDF file.
documentEditor.save(toPath: saveToPath) { document, error in
    if let error = error {
        print("Error saving document. Error: \(error)")
    }
}

```

## Using Processor

The [`Processor`](https://www.nutrient.io/api/ios/documentation/pspdfkit/processor) class, as the name suggests, allows you to process PDF documents. These operations include document creation, merging, and modification.

After configuring the page as described in the first section, it’s added to [`Processor.Configuration`](https://www.nutrient.io/api/ios/documentation/pspdfkit/processor/configuration), which in turn is used to create a [`Processor`](https://www.nutrient.io/api/ios/documentation/pspdfkit/processor) object that will generate the actual PDF.

The example below shows how to generate a PDF using the [`Processor`](https://www.nutrient.io/api/ios/documentation/pspdfkit/processor) API:

```swift

let configuration = Processor.Configuration()
configuration.addNewPage(at: 0, configuration: newPageConfiguration)

// Save to a new PDF file.
let processor = Processor(configuration: configuration, securityOptions: nil)
try processor.write(toFileURL: outputFileURL)

```

See [`NewDocumentCreationExample`](https://github.com/PSPDFKit/pspdfkit-ios-catalog/blob/master/Catalog/Examples/DocumentProcessing/NewDocumentCreationExample.swift) from the Catalog app for a complete example of how to generate a new PDF.
---

## Related pages

- [Generate PDFs from HTML on iOS](/guides/ios/pdf-generation/from-html.md)
- [Generate PDFs from images on iOS](/guides/ios/pdf-generation/from-images.md)
- [Generate PDFs from templates on iOS](/guides/ios/miscellaneous/custom-page-templates.md)
- [Generate PDFs from a PDF form in iOS](/guides/ios/pdf-generation/from-pdf-form.md)
- [PDF generation library for iOS](/guides/ios/pdf-generation.md)
- [Generate a password-protected PDF on iOS](/guides/ios/pdf-generation/password-protected-pdf.md)
- [Generate PDFs programmatically on iOS](/guides/ios/pdf-generation/programmatically.md)
- [Generate PDF thumbnails on iOS](/guides/ios/pdf-generation/thumbnail-preview.md)
- [Generate PDF reports on iOS](/guides/ios/generating-pdfs/generating-pdf-reports.md)

