---
title: "Convert images to PDF on iOS"
canonical_url: "https://www.nutrient.io/guides/ios/pdf-generation/from-images/"
md_url: "https://www.nutrient.io/guides/ios/pdf-generation/from-images.md"
last_updated: "2026-06-09T10:25:14.472Z"
description: "Learn how to generate PDFs from images on iOS using minimal code. Convert JPG, PNG, or TIFF easily with the Processor API."
---

# Generate PDFs from images 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

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

