Support Converting specific pages from PDF to images in C# .NET ?

back to home  >  Tech FAQ  >  Convert specific pages from PDF to images in C#

Question:

Hi, support team.

Before using your .net PDF to image library, I'm wondering that does the library support to translate customized pages from PDF to images? Such as only converting first five pages to images.

---- Gibson

Answer:

Hi, Gibson.

Of course, pqScan PDF to Image SDK allows developers to convert specific PDF pages to images. Not only support selecting first five pages, but also any type you want, like last three pages, or all the odd pages. The only thing you need is to pass the page index as parameter to pqScan PDF converter method in your .net application. And pqScan PDF converter will render the image to you depending on the input page index.

With the help of pqScan .net PDF to image converter, you can save the image as Jpeg/Jpg, Png, Bmp, Tiff/Tif and Gif file format. Besides turnning wanted pages to images from PDF, you can also customize the exported image size and resolution.

Here we provide converting first 5 pages demo for you. This example is written in C# language code.

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


namespace PDFToImageQuestion
{
    class Program
    {
        static void Main(string[] args)
        {
            //open your PDF document
            PDFDocument doc = new PDFDocument();
            doc.LoadPDF("sample.pdf");

            //set pages will converte
            int pageCount = 5 < doc.PageCount ? 5 : doc.PageCount;

            //convert first 5 pages to images
            for (int i = 0; i < pageCount; i++)
            {
                Bitmap bmp = doc.ToImage(i);
                bmp.Save("image" + i.ToString() + ".bmp");
            }
        }
    }
}

Hope the C# code can be helpful.

---- pqScan Support Team

Online Demo Download Trial Problem with converting PDF to image in Mac. How to use .NET PDF converter in Mono? Can .net PDF to image converter integrate to Windows7 or Windows8? Can I Get a Compression Jpeg Image from PDF ? How to convert PDF to high quality image in C#? How to get transparent background png from PDF document in C#? Support Converting specific pages from PDF to images in C# .NET ? Converting specific languagePDF to images is possible? Is convert special page size PDF to image possible? Converting specific style PDF to images is allowed?