---
title: "iOS PDF image extraction library — Extract images from PDFs | Nutrient"
canonical_url: "https://www.nutrient.io/guides/ios/extraction/image-extraction/"
md_url: "https://www.nutrient.io/guides/ios/extraction/image-extraction.md"
last_updated: "2026-06-09T10:25:14.464Z"
description: "Learn to programmatically extract bitmap images from a PDF page. for Nutrient iOS SDK."
---

# Extract images from PDFs on iOS

This guide shows how to programmatically extract bitmap images from a PDF page.

Embedded images in a PDF page are represented by the [`ImageInfo`](https://www.nutrient.io/api/ios/documentation/pspdfkit/imageinfo) class and can be retrieved via the [`images`](https://www.nutrient.io/api/ios/documentation/pspdfkit/textparser/images) property on [`TextParser`](https://www.nutrient.io/api/ios/documentation/pspdfkit/textparser). [`ImageInfo`](https://www.nutrient.io/api/ios/documentation/pspdfkit/imageinfo) also provides an assortment of image metadata properties, as well as methods to extract an image from a PDF as a [`UIImage`](https://developer.apple.com/documentation/uikit/uiimage). To obtain the text parser for a given page, use the [`Document.textParserForPage(at:)`](https://www.nutrient.io/api/ios/documentation/pspdfkit/pdfdocumentprovider/textparserforpage(at:)) API.

The code below will grab all the bitmap images from the first page of the given PDF document and make them available for further processing as [`UIImage`](https://developer.apple.com/documentation/uikit/uiimage) instances:

```swift

// Update to use your document name and location.
let fileURL = Bundle.main.url(forResource: "Document", withExtension: "pdf")!
let document = Document(url: fileURL)

guard let parser = document.textParserForPage(at: 0) else {
    print("Parsing failed.")
    return
}

let images: [UIImage] = imageInfos.compactMap { imageInfo in
    do {
        // Some PDF images are in the CMYK color space, which isn't a supported encoding.
        // Using this call converts all images to the RGB color space.
        return try imageInfo.imageInRGBColorSpace()
    } catch let error {
        print("Image processing failed. Error \(error.localizedDescription)")
        return nil
    }
}

// Do something with the images...
print("Found \(images.count) images.")

```

The [`TextParser`](https://www.nutrient.io/api/ios/documentation/pspdfkit/textparser) API also offers access to the page text. To learn more about it, refer to the [parsing](https://www.nutrient.io/guides/ios/extraction/parse-content.md) and [text extraction](https://www.nutrient.io/guides/ios/features/text-extraction.md) guides.
---

## Related pages

- [PDF extraction library for iOS](/guides/ios/extraction.md)
- [Extract metadata from PDFs on iOS](/guides/ios/extraction/metadata.md)
- [Extract pages from PDFs on iOS](/guides/ios/extraction/page-extraction.md)
- [Extract selected text from PDFs on iOS](/guides/ios/extraction/selected-text.md)
- [Extract text from PDFs on iOS](/guides/ios/features/text-extraction.md)
- [Parse PDF content on iOS](/guides/ios/extraction/parse-content.md)
- [Extract the text position from PDFs on iOS](/guides/ios/extraction/text-position.md)

