---
title: "Generate PDF thumbnails with iOS library | Nutrient SDK"
canonical_url: "https://www.nutrient.io/guides/ios/pdf-generation/thumbnail-preview/"
md_url: "https://www.nutrient.io/guides/ios/pdf-generation/thumbnail-preview.md"
last_updated: "2026-06-09T10:25:14.472Z"
description: "Generate PDF thumbnails with iOS library | guide for Nutrient iOS SDK with detailed instructions and code examples."
---

# Generate PDF thumbnails on iOS

A thumbnail is a low-resolution image representation of a PDF page. Thumbnails are generally used to recognize, navigate, or organize PDF pages. Generating a thumbnail preview of a PDF page is a common use case for any app that displays PDFs.

To render a thumbnail image from a PDF file in Nutrient iOS SDK, you need to do the following:

```swift

// Create a URL for the PDF file.
guard let path = Bundle.main.path(forResource: "report", ofType: "pdf") else { return }
let url = URL(fileURLWithPath: path)

// Instantiate a `Document` from the PDF file's URL.
let document = Document(url: url)

let pageIndex: PageIndex = 0
guard let pageImageSize = document.pageInfoForPage(at: pageIndex)?.mediaBox.size else { return }

// Set the thumbnail size to be five times smaller than the actual page size.
let thumbnailImageSize = CGSize(width: pageImageSize.width / 5, height: pageImageSize.height / 5)

// Create a render request from your `Document`.
let request = MutableRenderRequest(document: document)
request.imageSize = thumbnailImageSize
request.pageIndex = pageIndex

do {
    // Create a render task using the `MutableRenderRequest`.
    let task = try RenderTask(request: request)
    task.priority =.utility
    PSPDFKit.SDK.shared.renderManager.renderQueue.schedule(task)

    // The page is rendered as a `UIImage`.
    let image = try PSPDFKit.SDK.shared.cache.image(for: request, imageSizeMatching: [.allowLarger])
} catch {
    // Handle error.
}

```

The [`RenderTask`](https://www.nutrient.io/api/ios/documentation/pspdfkit/rendertask) API used in the above example is an asynchronous API that won’t block the main thread when rendering a PDF page to an image. It includes an image cache by default, so multiple render calls for the same page are fetched directly from the cache. For a more detailed explanation of image rendering, check out our guide on [rendering PDF pages](https://www.nutrient.io/guides/ios/getting-started/rendering-pdf-pages.md) and our blog post on [converting a PDF to an image](https://www.nutrient.io/blog/convert-pdf-to-image-in-swift/).

Additionally, Nutrient provides another API to render a PDF page to an image: [`imageForPage:at:size:clippedTo:annotations:options`](https://www.nutrient.io/api/ios/documentation/pspdfkit/document/imageforpage(at:size:clippedto:annotations:options:)). One thing to keep in mind is that this is a synchronous call that will block the main thread when it’s rendering a particularly large or complex PDF page.
---

## Related pages

- [Generate blank PDFs on iOS](/guides/ios/features/document-creation.md)
- [Generate PDFs from images on iOS](/guides/ios/pdf-generation/from-images.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)

