PDF to image - C Sharp sample - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

PDF to image – C Sharp sample

PDF to image C# tutorial shows PDF to PNG conversion in C Sharp using PDF Renderer SDK. Use the sample source code below to convert PDF to image.

You can find this sample for ASP.NET, VB, VBScript and C# in trial version of PDF Renderer SDK. Go to Dashboard > PDF to Image (simple).

C#

using System;
using Bytescout.PDFRenderer;

namespace BasicExample
{
class Program
{
 static void Main(string[] args)
 {
 	// Create an instance of Bytescout.PDFRenderer.RasterRenderer object and register it.
 	RasterRenderer renderer = new RasterRenderer();
 	renderer.RegistrationName = "demo";
 	renderer.RegistrationKey = "demo";

 	// Load PDF document.
 	renderer.LoadDocumentFromFile("multipage.pdf");

 	// Render first page of the document to PNG image file.
 	renderer.RenderPageToFile(0, RasterOutputFormat.PNG, "result.png");

 	// Open the output file in default image viewer.
 	System.Diagnostics.Process.Start("result.png");
 }
}
}

Tutorials:

prev
next