---
title: "Image-to-PDF conversion for iOS | Nutrient iOS SDK"
canonical_url: "https://www.nutrient.io/guides/ios/conversion/image-to-pdf/"
md_url: "https://www.nutrient.io/guides/ios/conversion/image-to-pdf.md"
last_updated: "2026-06-08T19:21:59.224Z"
description: "Learn how to convert images to PDF format on iOS using minimal code. Follow our step-by-step guide to generate high-quality PDFs from images programmatically in your iOS app."
---

# Convert images to PDF on iOS

Images are widely used to display content and graphics, but sometimes a PDF format is necessary. Use the [`Processor`](https://www.nutrient.io/api/ios/documentation/pspdfkit/processor) API to convert a `UIImage` into a PDF file with minimal code.

To convert an image to PDF, your license must include the **Document Editor** component, and to annotate images, your license must include the **Image Document** component.
 Contact our [Sales team](/contact-sales) for assistance.

## Converting a single image to a PDF

Follow the steps below to convert an image to a PDF.

- Create a [`PDFNewPageConfiguration`](https://www.nutrient.io/api/ios/documentation/pspdfkit/pdfnewpageconfiguration) object to define the page settings as follows:
  - Specify the image to use.
  - Set the compression quality.
  - Define the page size.

- Create a [`Processor.Configuration`](https://www.nutrient.io/api/ios/documentation/pspdfkit/processor/configuration) and add the [`PDFNewPageConfiguration`](https://www.nutrient.io/api/ios/documentation/pspdfkit/pdfnewpageconfiguration) instance as the configuration for the first page.

- Use [`Processor`](https://www.nutrient.io/api/ios/documentation/pspdfkit/processor) to generate the PDF and write it to the specified `outputFilePath`.

The following code sample demonstrates how to convert a single image to a PDF:

```swift

let image: UIImage =...
let outputFileURL: URL =... // Writable file URL.
let pageTemplate = PageTemplate(pageType:.emptyPage, identifier: nil)
let newPageConfiguration = PDFNewPageConfiguration(pageTemplate: pageTemplate) { builder in
    builder.item = ProcessorItem(image: image, jpegCompressionQuality: 0.7, builderBlock: nil)
    builder.pageSize = image.size
}

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

do {
    try Processor(configuration: configuration, securityOptions: nil).write(toFileURL: outputFileURL)
} catch {
    print("Could not create PDF file: \(error)")
}

```

## Converting multiple images to a PDF

Follow the steps below to convert multiple images to a PDF.

- Create multiple [`PDFNewPageConfiguration`](https://www.nutrient.io/api/ios/documentation/pspdfkit/pdfnewpageconfiguration) objects, each containing a different image.

- Add each `newPageConfiguration` to [`Processor.Configuration`](https://www.nutrient.io/api/ios/documentation/pspdfkit/processor/configuration), as demonstrated in the code sample below:

```swift

configuration.addNewPage(at: 0, configuration: newPageConfiguration0)
configuration.addNewPage(at: 1, configuration: newPageConfiguration1)
configuration.addNewPage(at: 2, configuration: newPageConfiguration2)...

```
---

## Related pages

- [PDF conversion library for iOS](/guides/ios/conversion.md)
- [Convert HTML to PDF on iOS](/guides/ios/conversion/html-to-pdf.md)
- [MS Office converter for iOS](/guides/ios/features/office-conversion.md)
- [Convert images to text on iOS](/guides/ios/conversion/image-to-text.md)
- [Convert PDFs to images on iOS](/guides/ios/conversion/pdf-to-image.md)
- [Scan and convert to searchable PDFs on iOS](/guides/ios/conversion/scan-to-searchable-pdf.md)

