PDF to Image - pqScan.com
C# PDF to Specific Size Images Converting PDF into Custom size Images in C# Online Demo Download Trial Purchase Now
C#.NET
VB.NET

How to Specify Images Converted through PDF in C# .NET?

back to home  >  PDF to Image SDK  >  How to Convert PDF to Image  >  Convert PDF to Specify Size Images

The pqScan PDF To Image SDK, in default, the DPI is set to 72. It means if you don't reset the dpi or image size properties, you will get an image rendered by 72 dpi with original size. However, in many situations, default value is not matched all the time, so our SDK allows you to reset DPI and Resize the image.

User-defined Image Size (PDF to single page type image) -- C Sharp sample

PDF to single page type images(tiff, png, jpeg, gif, bmp), you can set DPI property and customize each page size under current dpi.

using System;
using System.Drawing;
using System.Drawing.Imaging;
using PQScan.PDFToImage;

namespace SpecifyImageSize
{
  Class Program
  {
    Static void Main(string[] args)
    {
      // Create an instance of PQScan.PDFToImage.PDFDocument object.
      PDFDocument pdfDoc = new PDFDocument();

      // Load PDF document.
      pdfDoc.LoadPDF("sample.pdf");

      // Set dpi to render image
      pdfDoc.DPI = 96;

      //Get total page count.
      int count = pdfDoc.PageCount;

      for (int i = 0; i < count; i++)
      {
        //Convert page to image in target size
        Bitmapbmp = pdfDoc.ToImage(i, 100, 200);
        //Save image 
        bmp.Save("output" + i + ".png", ImageFormat.Png);
      }
    }
  }
}

User-defined Image Size (PDF to multiple page type image) -- C Sharp sample

PDF to multi-page tiff, we only provide DPI property to change the picture quality. So you can only get one whole tiff image in different dpi, without resizing each page.

using System;
using PQScan.PDFToImage;

namespace SpecifyImageSize
{
  Class Program
  {
    Static void Main(string[] args)
    {
      // Create an instance of PQScan.PDFToImage.PDFDocument object.
      PDFDocument pdfDoc = new PDFDocument();

      // Load PDF document.
      pdfDoc.LoadPDF("sample.pdf");

      // Set dpi to render whole image
      pdfDoc.DPI = 96;

      // Save multi-page tiff
      pdfDoc.ToMultiPageTiff("multipage.tiff");
    }
  }
}
pqScan SDK
.NET PDF to Image Software
Online Guide
.NET PDF to Image Converting
Conversion Type
.NET Tutorial: Convert PDF to GIF .NET Tutorial: Convert PDF to JPEG C# Tutorial: Convert PDF to BMP C# Tutorial: Convert PDF to JPG C# Tutorial: Convert PDF to TIFF VB.NET Tutorial: Convert PDF to GIF ASP.NET Tutorial: Convert PDF to JPEG ASP.NET Tutorial: Convert PDF to Bitmap View All Image Types >>
I found pqScan.com by chance when looking for a .net solution for pdf document to images conversion. Then, tried its .net SDK and have a good result within two days! Now, I have already ordered your license. Mortimer