Below are the steps and sample code to convert a PDF file to GIF images.
Steps to convert PDF to GIF
- Create a
PdfRasterizerobject using the source PDF document.
- Call the
Drawmethod by specifying the image type as GIF, DPI and file path to save images.
Sample code - C#
PdfRasterizer rasterizer = new PdfRasterizer("doc-a.pdf"); rasterizer.Draw("output.gif", ImageFormat.Gif, ImageSize.Dpi150);
Clone or view the example project at GitHub. This example on this page is in the PdfToImageRasterizerExample.cs file.
The NuGet package and an example project are provided to get started.
DynamicPDF Rasterizer for .NET is available on NuGet with package ID
Install directly in Visual Studio using the NuGet Package Manager.
DynamicPDF Rasterizer Information
For more information, refer to the online help documentation.