.NET PDF to Image Converter SDK

Convert PDF to Image for ASP.NET
This page is a quick start to use CetSDK .NET PDF to Image Converter SDK for ASP.NET web application. You may quickly add and integrate our free .NET PDF converter library dll to your Visual Studio ASP.NET web project to evaluate and test. And we provide C# & VB.NET coding examples for how to load PDF document in ASP.NET web project, how to convert PDF document to image(s), and how to render and show it on ASPX web page.
PREPERATION FOR WEB PROJECT PDF CONVERSION
CnetSDK enables .NET developers to transform and convert PDF file to common raster image files, like PDF to JPEG, PDF to TIFF, PDF to PNG, PDF to BMP, and PDF to GIF. To use all mature PDF to image converting APIs and methods for your ASP.NET application, you need to firstly add and integrate .NET web project reference to CnetSDK.PDFtoImage.Converter.Trial.dll. Please choose a suitable .NET PDF converter library dll from downloaded package base on your Windows System (x86 & x64) and .NET Frameworks version (2.0 & above versions).

Please Note: a watermark ("www.cnetsdk.com") will be shown on each converted image file randomly if you are using free trial package of CnetSDK .NET PDF to Image Converter SDK.
CONVERT PDF TO IMAGE & SHOW ON WEB PAGE
CnetSDK .NET PDF to Image Converter SDK is a stand-alone PDF converter library for ASP.NET web form application and web services. It can be used to render and convert PDF (page) and show image(s) on ASPX web page. No other (Adobe) PDF readers or PDF viewers are required for your ASP.NET application.

If you already downloaded our .NET PDF to Image Converter SDK and added PDF library component to your Visual Studio ASP.NET project reference, you can directly use the following C# & VB.NET coding examples to have quick tests. Here, we only take PDF to Jpeg conversion and PDF to Tiff conversion as conversion examples.
1. C# Programming Code: Convert PDF and Show Image on ASPX Web Page


using System;
using System.Web.UI;
using System.IO;
using CnetSDK.PDFtoImage.Converter.Trial;


public partial class _Default: System.Web.UI.Page
{
  protected void Page_Load(object sender, EventArgs e)
  {
    // Prepare a PDF document for test.
    string PdfFileName = Server.MapPath("CnetSDK.pdf");


    // Create an instance of CnetSDK PDF file object.
    PdfFile PDFConverter = new PdfFile();


    // Load your PDF file to ASP.NET project.
    PDFConverter.LoadPdfFile(PdfFileName);


    // Prepare response.
    Response.Clear();
    Response.ContentType = "image/jpeg";


    // Convert the first page of PDF file to output image.
    System.Drawing.Image JpgImage = PDFConverter.ConvertToImage(0);

    using (MemoryStream ms = new MemoryStream())
    {
      // Save image file as JPEG image format.
      JpgImage.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);


      // Show JPEG image to your ASPX web page.
      Response.OutputStream.Write(ms.GetBuffer(), 0, (int)ms.Length);
      }
    JpgImage.Dispose();
    Response.End();
  }
}

2. VB.NET Programming Code: Convert PDF and Show Image on ASPX Web Page


Imports System
Imports System.Web.UI
Imports System.IO
Imports CnetSDK.PDFtoImage.Converter.Trial

Public partial Class _Default
 Inherits System.Web.UI.Page
  Protected  Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
    ' Prepare a PDF document for test.
    Dim PdfFileName As String = Server.MapPath("CnetSDKtest.pdf")


    ' Create an instance of CnetSDK PDF file object.
    Dim PdfConverter As PdfFile = New PdfFile()


    ' Load your PDF file to ASP.NET project.
    PdfConverter.LoadPdfFile(PdfFileName)


    ' Prepare response.
    Response.Clear()
    Response.ContentType = "image/jpeg"


    ' Convert the first page of PDF file to output image.
    Dim JpgImage As System.Drawing.Image = PdfConverter.ConvertToImage(0)

    Imports (MemoryStream ms = New MemoryStream())
    {
      ' Save image file as JPEG image format.
      JpgImage.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg)


      ' Show JPEG image to your ASPX web page.
      Response.OutputStream.Write(ms.GetBuffer(), 0, CType(ms.Length, Integer))
      }
    JpgImage.Dispose()
    Response.End()
  End Sub
End Class

CnetSDK .NET PDF Converter for Images SDK includes well-compiled and mature .NET APIs and methods for your .NET web & windows applications. If you want to get more .NET APIs and methods for C# & VB.NET programming, please see: C# Tutorial for PDF to Images Conversion, VB.NET Tutorial for PDF to Images Conversion.
MORE PDF TO IMAGES  CONVERSION

ASP.NET PDF Conversion to JPEG

ASP.NET PDF Conversion to PNG

ASP.NET PDF Conversion to BMP

ASP.NET PDF Conversion to GIF

ASP.NET PDF Conversion to Single Page TIFF

ASP.NET PDF Conversion to Multi-page TIFF