Our PDF to Image SDK can run in .NET Framework 2.0 or higher platform, compatible with C# programming language. This example demonstrates how to transform PDF document to TIFF image format in ASP.NET project for viewing online using C# language.
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 sample PDF file. string pdfFileName = Server.MapPath("sample.pdf"); // Create an instance of PQScan.PDFToImage.PDFDocument object. PDFDocument pdfDoc = new PDFDocument(); // Load your sample PDF file. pdfDoc.LoadPDF(pdfFileName); // Prepare response. Response.Clear(); Response.ContentType = "image/tiff"; // Render the first page of your PDF file to the output image. System.Drawing.Image tifImage = pdfDoc.ToImage(0); using (MemoryStream ms = new MemoryStream()) { // Save image as tif format. tifImage.Save(ms, System.Drawing.Imaging.ImageFormat.Tiff); // Show tif image to your aspx web page. Response.OutputStream.Write(ms.GetBuffer(), 0, (int)ms.Length); } tifImage.Dispose(); Response.End(); } }