How to C#: Converter
Use Convert SDK for C#
Adobe PDF to Image
Adobe PDF to Image
  |  
Home ›› XDoc.Converter ›› C# Converter: PDF to Raster Image

C# Image Convert: How to Convert Adobe PDF to Jpeg, Png, Bmp, & Gif Raster Images


XDoc.Converter for .NET Allows C# Developers to Perform PDF Document to Raster Images Conversion at Fast Speed






Adobe PDF document can be easily loaded into your C#.NET project and converted to common raster image file formats, like Jpeg, Png, Bmp, and Gif. Mature .NET APIs are provided for high performance PDF to raster images conversion. Please see detailed coding examples as below.




C# DLLs for PDF Conversion to Images


Add necessary references to your C# project:


  RasterEdge.Imaging.Basic.dll


  RasterEdge.Imaging.Basic.Codec.dll


  RasterEdge.Imaging.DICOM.dll


  RasterEdge.Imaging.Font.dll


  RasterEdge.Imaging.Drawing.dll


  RasterEdge.Imaging.JBIG2.dll


  RasterEdge.Imaging.JPEG2000.dll


  RasterEdge.Imaging.Processing.dll


  RasterEdge.XDoc.Converter.dll


  RasterEdge.XDoc.Excel.dll


  RasterEdge.XDoc.Office.Inner.Common.dll


  RasterEdge.XDoc.Office.Inner.Office03.dll


  RasterEdge.XDoc.PDF.dll


  RasterEdge.XDoc.PowerPoint.dll


  RasterEdge.XDoc.TIFF.dll


  RasterEdge.XDoc.Word.dll


  RasterEdge.XImage.AdvancedCleanup.Core.dll


  RasterEdge.XImage.OCR.dll


  RasterEdge.XImage.OCR.Tesseract.dll


  RasterEdge.XImage.Raster.Core.dll


  RasterEdge.XImage.Raster.dll


Use the namespaces


  using RasterEdge.Imaging.Basic;


  using RasterEdge.XDoc.Converter;




C# Guide for PDF to Jpeg



Simple example for converting PDF file to Jpeg image in your C# project. This demo code just converts first page to jpeg image.




String inputFilePath = @"C:\input.pdf";
String outputFilePath = @"C:\output.jpg";

// Convert PDF to jpg.
ConvertResult result = DocumentConverter.ToImage(inputFilePath, outputFilePath, FileType.IMG_JPEG);



C# sample code for PDF to jpg image conversion. This demo code convert PDF file all pages to jpg images.




// Define input and output files path.
String inputFilePath = @"C:\input.pdf";
String outputDirectory = @"C:\output\";

// Convert PDF to jpg and show conversion result.
ConvertResult result = DocumentConverter.ToImages(inputFilePath, outputDirectory, "output", FileType.IMG_JPEG);




C# Guide for PDF to Png



C# demo code for PDF file to Png image rendering and converting. This demo code just converts first page to png image.




String inputFilePath = @"C:\input.pdf";
String outputFilePath = @"C:\output.png";

// Convert PDF to png.
ConvertResult result = DocumentConverter.ToImage(inputFilePath, outputFilePath, FileType.IMG_PNG);



C# sample code for PDF to jpg image conversion. This demo code convert PDF file all pages to png images.




// Define input and output files path.
String inputFilePath = @"C:\input.pdf";
String outputDirectory = @"C:\output\";

// Convert PDF to png and show conversion result.
ConvertResult result = DocumentConverter.ToImages(inputFilePath, outputDirectory, "output", FileType.IMG_PNG);




C# Guide for PDF to Bmp



Copy the code below to your .NET project to test fast PDF to Bmp conversion. This demo code just converts first page to bmp image.




String inputFilePath = @"C:\input.pdf";
String outputFilePath = @"C:\output.bmp";

// Convert PDF to bmp.
ConvertResult result = DocumentConverter.ToImage(inputFilePath, outputFilePath, FileType.IMG_BMP);



C# sample code for PDF to jpg image conversion. This demo code convert PDF file all pages to bmp images.




// Define input and output files path.
String inputFilePath = @"C:\input.pdf";
String outputDirectory = @"C:\output\";

// Convert PDF to bmp and show conversion result.
ConvertResult result = DocumentConverter.ToImages(inputFilePath, outputDirectory, "output", FileType.IMG_BMP);




C# Guide for PDF to Gif



This example shows how to load a PDF file and render it to Gif image file. This demo code just converts first page to gif image.




String inputFilePath = @"C:\input.pdf";
String outputFilePath = @"C:\output.gif";

// Convert PDF to gif.
ConvertResult result = DocumentConverter.ToImage(inputFilePath, outputFilePath, FileType.IMG_GIF);



C# sample code for PDF to jpg image conversion. This demo code convert PDF file all pages to gif images.




// Define input and output files path.
String inputFilePath = @"C:\input.pdf";
String outputDirectory = @"C:\output\";

// Convert PDF to gif and show conversion result.
ConvertResult result = DocumentConverter.ToImages(inputFilePath, outputDirectory, "output", FileType.IMG_GIF);