---
title: "Save PDFs locally on iOS devices"
canonical_url: "https://www.nutrient.io/guides/ios/save-a-document/to-local-storage/"
md_url: "https://www.nutrient.io/guides/ios/save-a-document/to-local-storage.md"
last_updated: "2026-06-08T17:11:05.553Z"
description: "Learn how to save modified PDF documents to local storage on iOS with customizable autosaving options using Nutrient."
---

# Save PDFs to local storage on iOS

Nutrient [automatically saves](https://www.nutrient.io/guides/ios/annotations/annotation-and-bookmark-saving-triggers.md) a modified file-based document to your device’s local storage. You can also [customize the autosaving behavior](https://www.nutrient.io/guides/ios/annotations/annotation-and-bookmark-saving-triggers.md#customize-autosaving) or [manually save](https://www.nutrient.io/guides/ios/annotations/annotation-and-bookmark-saving-triggers.md#manual-saving) the changes. Note that files are saved locally on your device, and no server is required.

The example below shows how to save a document on the main thread programmatically:

```swift

let document =...

// Manually save the document.
try? document.save()

```

## Saving data-backed documents to local storage

If you’re working with a [data-backed document](https://www.nutrient.io/guides/ios/open-a-document/from-in-memory-data.md) and wish to save it as a PDF file on your device’s local storage, you can use the [`Processor`](https://www.nutrient.io/api/ios/documentation/pspdfkit/processor) API, like so:

```swift

let document =...

// Manually save the document.
try? document.save()

// Generate a new document with embedded annotations.
guard let processorConfiguration = Processor.Configuration(document: document) else {
    print("Could not create a processor configuration. The document might be locked or invalid.")
    return
}

processorConfiguration.modifyAnnotations(ofTypes:.all, change:.embed)

let docsFolder = FileManager.default.urls(for:.documentDirectory, in:.userDomainMask).first!
let outputURL = docsFolder.appendingPathComponent("local.pdf")

let processor = Processor(configuration: processorConfiguration, securityOptions: nil)
do {
    // Write the modified document. This can be used to initialize
    // and present a new Nutrient document.
    try processor.write(toFileURL: outputURL)
} catch {
    print(error)
}

```

For more details about using the [`Processor`] API to write a document on local storage, refer to [`XFDFAnnotationProviderEmbeddedExample.swift`] in the [Nutrient Catalog](https://github.com/PSPDFKit/pspdfkit-ios-catalog) app.
---

## Related pages

- [Incremental PDF saving on iOS](/guides/ios/faq/growing-pdf-file-size.md)
- [Automatically save PDFs on iOS](/guides/ios/features/document-checkpointing.md)
- [Save PDFs to a custom data provider on iOS](/guides/ios/save-a-document/to-custom-data-provider.md)
- [Save PDF documents on iOS](/guides/ios/save-a-document.md)
- [Conflict resolution when saving PDFs on iOS](/guides/ios/features/conflict-resolution.md)
- [Save PDFs to Document Engine on iOS](/guides/ios/save-a-document/to-document-engine.md)
- [How to save PDFs on iOS](/guides/ios/save-a-document/save-as.md)
- [Save and upload PDFs on iOS devices](/guides/ios/save-a-document/to-remote-server.md)

