Converting PDF to Images using PdfConverter

Skip to end of metadata
Go to start of metadata
Converting PDF to Images using PdfConverter

Aspose.Pdf.Kit allows you to convert an existing PDF and its individual pages to images. PdfConverter class allows you converter PDF pages into various types of images i.e. JPEG, PNG, BMP, TIFF etc. You can convert all the pages to images or the pages between a specified page range.

The following sample code shows you how to convert PDF file to images.

[Java]
//create PdfConverter object and bind input PDF
PdfConverter converter = new PdfConverter();
converter.bindPdf("input.pdf");

//set start and end pages
converter.setStartPage(1);
converter.setEndPage(1);

//initialize conversion process
converter.doConvert();

//convert pages to images
String suffix = ".jpg";
int imageCount = 1;
while (converter.hasNextImage())
{
   converter.getNextImage(imageCount + suffix,ImageType.JPEG);
   imageCount++;
}

//convert PDF to TIFF format
converter.saveAsTIFF("output.tif");
 
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.