---
title: "Easily Convert Your PDF to Images in C#"
published_at: "2024-08-14T12:00:24+00:00"
modified_at: "2025-12-08T11:30:18+00:00"
url: "https://www.syncfusion.com/blogs/post/convert-pdf-to-images-in-csharp"
excerpt: "Learn to convert PDF to images in C# using Syncfusion's PdfToImageConverter. Step-by-step guide for ASP.NET, WinForms, WPF. Easy, fast, reliable!"
taxonomy_category:
  - "C#"
  - "File Formats"
  - "PDF"
  - "Syncfusion"
taxonomy_post_tag:
  - "C#"
  - "csharp"
  - "Document Processing"
  - "File Formats"
  - "PDF"
  - "Syncfusion"
  - "Tips and Tricks"
---

# Easily Convert Your PDF to Images in C#

[Vikas S](https://www.syncfusion.com/blogs/author/vikas-s)

![Easily Convert Your PDF to Images in C#](https://www.syncfusion.com/blogs/wp-content/uploads/2024/08/Easily-Convert-Your-PDF-to-Images-in-C.jpg)


**TL;DR:**: Learn how to effortlessly convert PDF pages into images using Syncfusion’s PdfToImageConverter in C#. This guide covers step-by-step instructions for various platforms, including ASP.NET Core, ASP.NET MVC, WinForms, and WPF. Discover how to install the necessary NuGet packages, set up your project, and implement the conversion code to transform PDF files into images efficiently.

Exporting PDF document pages as images can often be a challenging task. To simplify this process, we’ve developed our Syncfusion [PdfToImageConverter](https://www.syncfusion.com/document-processing/pdf-framework/net/pdf-library/pdf-to-image)
, which uses [PDFium](https://pdfium.googlesource.com/pdfium/+/master/README.md)
 to convert PDF documents into images. PDFium, the same engine used in Google Chrome for rendering PDF files, provides accurate and robust PDF rendering.

In this blog, we’ll guide you through the steps to easily export PDF pages as images across Windows-specific and cross-platforms.


## Supported frameworks and platforms

The following table displays the supported frameworks and platforms and the corresponding Syncfusion **[PdfToImageConverter](https://www.nuget.org/packages/Syncfusion.PdfToImageConverter.Net)** NuGet packages they support.

| Frameworks | Platforms | Windows-specific / Cross-Platforms | NuGet Package |
| --- | --- | --- | --- |
| net8.0-windows7.0 / net9.0-windows7.0 /net462 | WinForms | Windows-specific | Syncfusion.PdfToImageConverter.WinForms |
| WPF | Windows-specific | Syncfusion.PdfToImageConverter.WPF |  |
| net45 | ASP.NET MVC | Windows-specific | Syncfusion.PdfToImageConverter.AspNet.Mvc5 |
| net8.0 / net9.0 / netstandard2.0 | ASP.NET Core , Blazor | Cross-Platforms | Syncfusion.PdfToImageConverter.Net |

## Getting started with PdfToImageConverter

This section explains how to create an application in ASP.NetCore(Cross-Platforms) and WPF (Windows-specific) for converting the PDF to Images.

**Note:** For more details, refer to [PDF to image conversion in C# documentation](https://help.syncfusion.com/document-processing/pdf/conversions/pdf-to-image/net/convert-pdf-to-image)
.


## Convert PDF document to images in ASP.NET Core (Cross-Platforms)

Follow these steps to convert your PDF document into images in an ASP.NET Core app:

1. First, create a new C# ASP.NET Core web application project.
2. Install the [Syncfusion.PdfToImageConverter.Net](https://www.nuget.org/packages/Syncfusion.PdfToImageConverter.Net/) NuGet package as a reference to your .NET Standard apps from the [NuGet Gallery](https://www.nuget.org/) .**Note:** If you want to use the **PdfToImageConverter** in the Linux environment, you need to install the [SkiaSharp.NativeAssets.Linux v2.88.6](https://www.nuget.org/packages/SkiaSharp.NativeAssets.Linux/2.88.6) NuGet package as a reference to your app from [NuGet Gallery](https://www.nuget.org/) .

1. A default file named **HomeController.cs** gets added when creating the ASP.NET Core project. Now, include the following namespace in the ** HomeController.cs** file.``` using Syncfusion.PdfToImageConverter; ```

1. Let’s add a new button to convert the PDF document to images in the **index.cshtml** file, as shown below.``` @{Html.BeginForm("ExportToImage", "Home", FormMethod.Post); { <div> <input type="submit" value="Convert Image" style="width:150px;height:27px" /> </div> } Html.EndForm(); } ```

1. Add a new action method named **ExportToImage** in the ** HomeController.cs** file and include the following code example to convert PDF documents to images using the ** Convert** method in the ** PdfToImageConverter** class.``` //Initialize the PDF to Image converter. PdfToImageConverter imageConverter = new PdfToImageConverter(); //Load the PDF document as a stream. FileStream inputStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.ReadWrite); imageConverter.Load(inputStream); //Convert PDF to image. Stream outputStream = imageConverter.Convert(0, false, false); MemoryStream stream = outputStream as MemoryStream; byte[] bytes = stream.ToArray(); using (FileStream output = new FileStream("output.png", FileMode.OpenOrCreate, FileAccess.ReadWrite)) { output.Write(bytes, 0, bytes. Length); } ``` After executing the above code examples, we’ll get the following output.

![Converting a PDF document to image in an ASP.NET Core app](https://www.syncfusion.com/blogs/wp-content/uploads/2024/08/Converting-a-PDF-document-to-image-in-an-ASP.NET-Core-app.png)

Converting a PDF document to image in an ASP.NET Core app

Also, refer to refer to the example on [GitHub](https://github.com/SyncfusionExamples/how-to-convert-PDF-to-Image-in-net/tree/master/PDF-to-Image/PDF-to-Image)
 for converting PDF to images in an ASP.NET Core app.

Similarly, we can use the **PdfToImageConverter.Net** NuGet to [convert a PDF to images in a Blazor app](https://help.syncfusion.com/document-processing/pdf/conversions/pdf-to-image/net/convert-pdf-file-to-image-in-blazor)
.

**Note:** The**PdfToImageConverter.Net** relies on the ** Pdfium** assembly. However, it is not supported in the ** Blazor WebAssembly** due to the framework’s restrictions on accessing assemblies.


## Convert PDF document to images in WPF (Windows-specific)

Follow these steps to convert your PDF document into images in a WPF app:

1. Create a new WPF app project.
2. Install the [Syncfusion.PdfToImageConverter.WPF](https://www.nuget.org/packages/Syncfusion.PdfToImageConverter.WPF/) NuGet package as a reference to your WPF app from [NuGet Gallery](https://www.nuget.org/) .
3. Include the following namespaces in the **MainWindow.xaml.cs** file.``` using Syncfusion.PdfToImageConverter; using System.Drawing; using System.IO; using System.Windows; ```

1. Add a new button in the **MainWindow.xaml** file to convert a PDF to images.``` <Grid HorizontalAlignment="Left" Margin="0,0,0,-0.333" Width="793"> <Button Content="Convert PDF to Image" HorizontalAlignment="Left" Margin="318,210,0,0" VerticalAlignment="Top" Width="166" Click=" btnCreate_Click " Height="19"/> <TextBlock HorizontalAlignment="Left" Margin="222,177,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="17"/> <TextBlock HorizontalAlignment="Left" Margin="291,175,0,0" TextWrapping="Wrap" Text="Click the button to convert PDF to Image." VerticalAlignment="Top"/> </Grid> ```

1. Add the following code in the **btnCreate_Click** event to convert a PDF document to images using the ** Convert** method in the ** PdfToImageConverter**class.``` //Initialize the PDF to Image converter. PdfToImageConverter imageConverter = new PdfToImageConverter(); //Load the PDF document as a stream. FileStream inputStream = new FileStream("Input.pdf", FileMode.Open,FileAccess.ReadWrite); imageConverter.Load(inputStream); //Convert PDF to image. Stream outputStream = imageConverter.Convert(0, false, false); Bitmap image = new Bitmap(outputStream); image. Save("sample.png"); ```

**Note:** For reference, refer to the example on [GitHub](https://github.com/SyncfusionExamples/WPF-PDFViewer-Examples/tree/master/PDF-to-image/PDF-to-image-in-Windows)
 for converting a PDF to images in a WPF app.


## Conclusion

Thanks for reading! In this blog, we’ve seen how to convert a PDF document to images using the Syncfusion [PDFtoImageConverter](https://www.syncfusion.com/document-processing/pdf-framework/net/pdf-library/pdf-to-image)
 and C# across in various supported platforms. Try out the steps in this blog and provide your feedback in the comments below!

The existing customers can download the latest version of Essential Studio® from the [License and Downloads](https://www.syncfusion.com/account/login)
 page. If you are new, try our 30-day [free trial](https://www.syncfusion.com/downloads)
 to explore our incredible features.

You can also contact us through our [support forums](https://www.syncfusion.com/forums)
, [support portal](https://support.syncfusion.com/)
, or [feedback portal](https://www.syncfusion.com/feedback)
. We are always happy to assist you!

## Related blogs

- [Create, Fill, and Edit Fillable PDF Forms Using C# – A Complete Guide](https://www.syncfusion.com/blogs/post/create-fill-edit-pdf-forms-using-csharp)
- [Secure Your PDF Documents Like a Pro Using C#](https://www.syncfusion.com/blogs/post/secure-your-pdf-documents-csharp)
- [Top 10 Must-Have Features in C# PDF Library](https://www.syncfusion.com/blogs/post/top-features-csharp-pdf-library)
- [Create PDF/A-4 Documents for Long-Term Archiving in C#](https://www.syncfusion.com/blogs/post/create-pdf-a-4-documents-for-long-term-archiving-in-c)
