Guide for C#
Core Document Formats
Additional Features

C# PDF - Convert PDF to JPEG in C#.NET

C#.NET PDF to JPEG Converting & Conversion Control

Visual C#
Home > .NET Imaging SDK > C# > Convert PDF to JPEG
If this is your first time to use our DocImageSDK, we strongly suggest you reading How to Start first!

RasterEdge PDF to JPEG converting control SDK is great to convert PDF document to JPEG image file in .NET developing platforms using simple C# programming code. JPEG image file, owing to its small-size feature, is counted as a more suitable choice for publishing in web services than PDF document file.
Using this C#.NET PDF to JPEG conversion library component toolkit, C# developers can easily and quickly convert a large-size multi-page PDF document to a group of high-quality separate JPEG image files within .NET developing platforms, including ASP.NET web site and Window Forms application.
When using RasterEdge PDF to JPEG converter library control SDK, C# developers may need to name all those converted JPEG image files in .NET class application. By default, this C#.NET PDF to JPEG converter library will name converted JPEG image files in the template of (PDF page number).jpg.
Now please look at the article layout of this C#.NET PDF to JPEG conversion / converting library control tutorial page.
  • Feature list of C#.NET PDF to JPEG converting library control SDK
  • How to start a C#.NET class application for PDF to JPEG conversion
  • C#.NET method to convert PDF document to JPEG image file
  • How to convert PDF to JPEG using sample C# demo code
  • C#.NET PDF to JPEG conversion FAQs
C# PDF to JPEG Conversion Control Features
  • Standalone C# PDF to JPEG converting library, no Adobe Acrobat and Reader are required
  • Professional PDF to JPEG converter toolkit, featured with intelligent conversion functions for large PDF files
  • Mature PDF to JPEG converter which allows C# developers to specify converted JPEG image resolution
  • Own advanced ability to convert each PDF page into separate JPEG image file using C#.NET
Convert PDF to JPEG Using C#.NET
RasterEdge PDF to JPEG converting library toolkit is an extremely easy-to-use .NET solution. Therefore, you can perform fast and high-fidelity PDF to JPEG conversion within a few steps.
  1. Download trial version of RasterEdge DocImage SDK for .NET and add following dlls of PDF to JPEG converting SDK to your own C#.NET class application as project assemblies;
    • RasterEdge.Imaging.Basic.dll
    • RasterEdge.Imaging.PDF.dll
  2. Then activate .NET Imaging SDK license and copy licensed .txt file to your project folder, together with the DLLs;
  3. Copy and paste the sample C# demo code (listed in following section);
  4. Now you can convert PDF to JPEG document file using C#.NET.
C# Method to Convert PDF to JPEG
RasterEdge PDF to JPEG document uses two methods to achieve the conversion between PDF document and JPEG image file. One is OpenDocumentFile method which you can use to open a PDF document file. The other is SaveImageFile method which you can use to save target object in JPEG image format.
// Method to open PDF document file in C# project
public static REDocument OpenDocumentFile(string filePath);
public static REDocument OpenDocumentFile(string filePath, BaseDecoder dec);

// Method to save PDF document to image file in C# project
public static void SaveImageFile(REImage image, string filePath);
public static void SaveImageFile(REImage image, string filePath, BaseEncoder enc);
C# Demo Code to Convert PDF to JPEG
The sample C# code below is used to illustrate how to achieve page-to-page conversion using C#.NET PDF to JPEG converter library.
using RasterEdge.Imaging.Basic;
using RasterEdge.Imaging.Basic.Core;
using RasterEdge.Imaging.Basic.Codec;
using RasterEdge.Imaging.PDF;
using System.Diagnostics;


namespace RE__Test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

public static string FolderName = "c:/";

private void button1_Click(object sender, EventArgs e)
{
string fileName = FolderName + "Sample.pdf";

REDocument doc = REFile.OpenDocumentFile(fileName, new PDFDecoder());//use PDFDecoder open a pdf file

int pageCount = doc.GetPageCount();//get pdf's page count

for (int pgIdx = 0; pgIdx < pageCount; pgIdx++)
{
BasePage aPage = doc.GetPage(pgIdx);//get page from REDocument

try
{
REImage img = (REImage)aPage.ToImage();//translate page to image
REFile.SaveImageFile(img, FolderName + "output" + pgIdx + ".jpg", new JPGEncoder());//save image
}
catch (Exception)
{
Debug.WriteLine("Fail to display page " + pgIdx);
}
}

}

}
}
C# PDF to JPEG Converting Control FAQs
Q 1: The PDF document that I need to convert is a large-size file containing over 1000 pages. So I wonder does C# PDF to JPEG converting control have any limitation on the size of target PDF document file.
A 1: RasterEdge PDF to JPEG converter control has no limitation on source PDF document file. And it is great for 1000+ page PDF document to JPEG conversion using C#.NET.

Q 2: Does your PDF to JPEG converter control support converting all pages of a multi-page PDF document to one JPEG image file?
A 2: Sorry, currently, our PDF to JPEG converting control only supports page-to-page conversion.
More Tutorials!
Find more user guides about document & image conversion using Visual C# sample codings!


Recommend this to Google+