Link
Skip to main content

How to set Image Quality value when converting a PDF to JPG?

You can do this with the following example code in Java.

ConvertPagesToImages convert = new ConvertPagesToImages("inputFile.pdf");
final JpegEncoderOptions options = new JpegEncoderOptions();
options.setQuality(90);//0-100
if (convert.openPDFFile()) {
    for (int page = 1; page <= convert.getPageCount(); page++) {
        BufferedImage bi = convert.getPageAsImage(page);
        //write out
        JDeli.write(bi, options, new File("outputFile" + page + ".jpg")); 
    }
}

You can find out more about the PDF to Image conversion here.


Why JPedal?

  • Actively developed commercial library with full support and no third party dependencies.
  • Process PDF files up to 3x faster than alternative Java PDF libraries.
  • Simple licensing options and source code access for OEM users.

Learn more about JPedal

Start Your Free Trial


Customer Downloads

Select Download