---
title: "Generate PDF thumbnails on Android"
canonical_url: "https://www.nutrient.io/guides/android/pdf-generation/thumbnail-preview/"
md_url: "https://www.nutrient.io/guides/android/pdf-generation/thumbnail-preview.md"
last_updated: "2026-06-09T10:32:42.696Z"
description: "Learn how to create low-resolution PDF page thumbnails using Android SDK with our step-by-step guide."
---

# Effortlessly generate PDF thumbnails on Android

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 Android SDK, you need to do the following:

### KOTLIN

```kotlin

try {
    // Create a Uri for the PDF file.
    val uri = Uri.parse("path/to/file.pdf")

    // Instantiate a `Document` from the PDF file's URL.
    val document =  PdfDocumentLoader.openDocument(context, uri)

    val pageIndex = 0
    val pageImageSize = document.getPageSize(pageIndex).toRect()

    // Set the thumbnail size to be five times smaller than the actual page size.
    val thumbnailImageSize = RectF(0f, 0f, pageImageSize.width() / 5, pageImageSize.height() / 5)

    // Create the image
    val bitmap = document.renderPageToBitmap(
        context,
        pageIndex
        thumbnailImageSize.width().toInt()
        thumbnailImageSize.height().toInt()
    )
} catch(ex: Exception) {
    // Handle error.
}

```

### JAVA

```java

try {
    // Create a Uri for the PDF file.
    final Uri uri = Uri.parse("path/to/file.pdf");

    // Instantiate a `Document` from the PDF file's URL.
    final PdfDocument document =  PdfDocumentLoader.openDocument(context, uri);

    final int pageIndex = 0;
    final RectF pageImageSize = document.getPageSize(pageIndex).toRect();

    //
    // Set the thumbnail size to be five times smaller than the actual page size.
    final RectF thumbnailImageSize = new RectF(0f, 0f, pageImageSize.width() / 5, pageImageSize.height() / 5);
    //

    // Create the image.
    final Bitmap bitmap = document.renderPageToBitmap(
        context,
        pageIndex,
        (int)thumbnailImageSize.width()
        (int)thumbnailImageSize.height()
    );
} catch(final Exception exception) {
    // Handle error.
}

```

Note that the [`renderPageToBitmap`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.document/-pdf-document/render-page-to-bitmap.html) API used in the above example is a synchronous API that will block whatever thread it’s called into, so make sure to either call it on a background thread or use the asynchronous method, [`renderPageToBitmapAsync`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.document/-pdf-document/render-page-to-bitmap-async.html).
---

## Related pages

- [Effortlessly generate PDFs from images on Android](/guides/android/pdf-generation/from-images.md)
- [Generate PDFs from HTML on Android](/guides/android/pdf-generation/from-html.md)
- [Generate blank PDFs on Android](/guides/android/features/document-creation.md)
- [Generate PDFs from a template on Android](/guides/android/pdf-generation/from-template.md)
- [PDF generation library for Android](/guides/android/pdf-generation.md)
- [Generate PDFs programmatically on Android](/guides/android/pdf-generation/programmatically.md)
- [Generate PDF reports on Android](/guides/android/generating-pdfs/generating-pdf-reports.md)

