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.
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");
