PDF to BMP - pqScan.com
ASP.NET PDF to BMP Conversion How to Convert PDF to BMP Images and Stream to View in ASP.NET Application Online Demo Download Trial Purchase Now
.NET C#.NET VB.NET
ASP.NET

How to Convert PDF to BMP in ASP.NET?

back to home  >  .NET PDF to Image SDK  >  How to Convert PDF to Image in .NET  >  Convert PDF to BMP for Web Viewing

This online tutorial will discuss how to use pqScan .NET PDF to Image Converting Library. More specifically, it will cover how to do PDF to bmp image conversion in ASP.NET web viewing project. Both C# and VB.NET programming languages are supported and free testing codes are provided in the next part.

If you've downloaded our .NET PDF Document Converter SDK package online, let's now get started.

  • Launch Visual Studio and create a new Web Site or ASP.NET Web Application;
  • Unzip pqScan .NET PDF to Image SDK free trial and add suitable DLL library to your web project reference;
  • Copy and paste sample codes below to web page load event;

Convert PDF to BMP -- ASP.NET Sample

The following free C# and VB.NET sample codes illustrate the use of our .NET PDF to image library control to convert PDF document to BMP images in ASP.NET web project.

C#: ASP.NET PDF-to-BMP Conversion

using System;
using System.Web.UI;
using System.IO;
using PQScan.PDFToImage;

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

    // Create an instance of PQScan.PDFToImage.PDFDocument object.
    PDFDocument pdfDoc = new PDFDocument();

    // Load the PDF document.
    pdfDoc.LoadPDF(pdfFileName);

    // Prepare response.
    Response.Clear();
    Response.ContentType = "application/x-bmp";

    // Render the first page of PDF document to the output image.
    System.Drawing.Image bmpImage = pdfDoc.ToImage(0);

    using (MemoryStream ms = new MemoryStream())
    {
      // Save image to bmp format.
      bmpImage.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);

      // Show bmp image to your aspx web page.
      Response.OutputStream.Write(ms.GetBuffer(), 0, (int)ms.Length);
    }

    bmpImage.Dispose();

    Response.End();
  }
}

VB: ASP.NET PDF-to-BMP Conversion

Imports System
Imports System.Web.UI
Imports System.IO
Imports PQScan.PDFToImage
 
Public partial Class _Default
     Inherits System.Web.UI.Page
  Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
    ' Prepare a test PDF file.
    Dim pdfFileName As String = Server.MapPath("sample.pdf") 
 
    ' Create an instance of PQScan.PDFToImage.PDFDocument object.
    Dim pdfDoc As PDFDocument = New PDFDocument() 
 
    ' Load the PDF file.
    pdfDoc.LoadPDF(pdfFileName)
 
    ' Prepare response.
    Response.Clear()
    Response.ContentType = "application/x-bmp"
 
    ' Convert the first page of PDF file to the output image.
    Dim bmpImage As System.Drawing.Image = pdfDoc.ToImage(0) 
 
    Imports (MemoryStream ms = New MemoryStream())
    {
      ' Save image to bmp file format.
      bmpImage.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp)
 
      ' Display bmp image to your aspx web page.
      Response.OutputStream.Write(ms.GetBuffer(), 0, CType(ms.Length, Integer))
    }
 
    bmpImage.Dispose()
 
    Response.End()
  End Sub
End Class

convert pdf to bmp in asp.net

pqScan SDK
.NET PDF to Image Library
Online Guide
PDF to Image Conversion in .NET
Conversion Type
.NET PDF to JPEG Conversion .NET PDF to GIF Conversion C# PDF to Multi-page TIF Conversion C# PDF to JPG Conversion C# PDF to PNG Conversion VB.NET PDF to JPEG Conversion VB.NET PDF to TIFF Conversion ASP.NET PDF to TIFF Conversion View All Image Types >>
I am very happy with choosing pqScan. The service support is very prompt, efficient and I get help on time. The price is also amazing. Of course, the thing I appreciate most is the product, functional and easy to use. Mike Harrison