---
title: "Create thumbnail from PDF in C# .NET | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/pdf-generation/thumbnail-preview/"
md_url: "https://www.nutrient.io/guides/dotnet/pdf-generation/thumbnail-preview.md"
last_updated: "2026-05-21T17:12:02.215Z"
description: "Learn how to create thumbnail previews from PDF documents programmatically in C# using Nutrient .NET SDK. Generate visual representations of your PDF pages."
---

# Create thumbnails from PDFs in C#

This guide explains how to create an image from a PDF document’s page. For example, you can use the created image as a thumbnail preview for the PDF document.

To create an image from a PDF document’s page, follow these steps:

1. Create a `GdPicturePDF` object and a `GdPictureImaging` object.

2. Load the source document by passing its path to the `LoadFromFile` method of the `GdPicturePDF` object.

3. Select the page from which to create an image with the `SelectPage` method of the `GdPicturePDF` object.

4. Render the selected page to an image with the `RenderPageToGdPictureImageEx` method of the `GdPictureImaging` object. This method takes the following parameters:
   - The dots-per-inch (DPI) resolution of the image.
   - A Boolean value that defines whether to include form fields and annotations in the image.

5. Save the image to a file with the `SaveAsPNG` method of the `GdPictureImaging` object.

6. Release unnecessary resources.

The example below creates a PNG image from a PDF document’s first page:

### C#

```csharp

using GdPicturePDF gdpicturePDF = new GdPicturePDF();
using GdPictureImaging gdpictureImaging = new GdPictureImaging();
// Load the source document.
gdpicturePDF.LoadFromFile(@"C:\temp\source.pdf");
// Select the first page.
gdpicturePDF.SelectPage(1);
// Render the selected page to an image.
int imageId = gdpicturePDF.RenderPageToGdPictureImageEx(200, true);
// Save the image to a file.
gdpictureImaging.SaveAsPNG(imageId, @"C:\temp\output.png");
// Release unnecessary resources.
gdpictureImaging.ReleaseGdPictureImage(imageId);

```

### VB.NET

```vb

Using gdpicturePDF As GdPicturePDF = New GdPicturePDF()
Using gdpictureImaging As GdPictureImaging = New GdPictureImaging()
    ' Load the source document.
    gdpicturePDF.LoadFromFile("C:\temp\source.pdf")
    ' Select the first page.
    gdpicturePDF.SelectPage(1)
    ' Render the selected page to an image.
    Dim imageId As Integer = gdpicturePDF.RenderPageToGdPictureImageEx(200, True)
    ' Save the image to a file.
    gdpictureImaging.SaveAsPNG(imageId, "C:\temp\output.png")
    ' Release unnecessary resources.
    gdpictureImaging.ReleaseGdPictureImage(imageId)
End Using

```

#### Used methods

- [`LoadFromFile`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~LoadFromFile.html)

- [`ReleaseGdPictureImage`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureImaging~ReleaseGdPictureImage.html)

- [`RenderPageToGdPictureImageEx`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~RenderPageToGdPictureImageEx.html)

- [`SaveAsPNG`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureImaging~SaveAsPNG.html)

- [`SelectPage`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SelectPage.html)

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)

- [Save a file](/guides/dotnet/save-a-file.md)

---

## Related pages

- [Create PDFs from byte arrays in C#](/guides/dotnet/pdf-generation/byte-array.md)
- [Generate a PDF from HTML in C#](/guides/dotnet/pdf-generation/from-html.md)
- [Generate PDFs in.NET](/guides/dotnet/pdf-generation.md)
- [Create PDFs from scratch in C#](/guides/dotnet/pdf-generation/from-scratch.md)
- [Create tagged PDFs in C#](/guides/dotnet/pdf-generation/tagged.md)
- [Generate a PDF from a DOCX template in C#](/guides/dotnet/pdf-generation/from-word-template.md)

