Link
Skip to main content

Convert PDF files to Images in Java

JPedal is a pure Java PDF library to provide Java Developers with the ability to convert the pages of PDF files to BufferedImage object or directly to image.

Create Thumbnails

All the conversion examples include a scaling option, making them an excellent way to generate thumbnails of a PDF file

Convert a PDF file into a BufferedImage

Convert PDF to BufferedImage

Convert PDF file to an Image file

Supported image conversions are:

Convert PDF to AVIF
Convert PDF to BMP
Convert PDF to GIF
Convert PDF to HEIC
Convert PDF to JPG
Convert PDF to JPEG2000
Convert PDF to PNG
Convert PDF to TIFF
Convert PDF to WEBP

Frequently Asked Questions

What image formats can JPedal convert PDF files to?

JPedal supports conversion to AVIF, BMP, GIF, HEIC, JPEG, JPEG2000, PNG, TIFF, and WEBP, as well as to a Java BufferedImage object for in-memory processing.

What is the default output resolution and how do I change it?

The default scaling of 1.33f matches Acrobat’s 100% view. To change the output resolution, pass a different float value to setPageScaling() — for example, 2.0f doubles the output dimensions. For higher-resolution output with additional control, use the ConvertPagesToHiResImages class.

How do I convert a single page instead of the whole PDF?

Use setPageRange() with a PageRanges value. For example, convert.setPageRange(new PageRanges("3")) converts only page 3. Ranges follow the SetOfIntegerSyntax format — "1-5,8,10" converts pages 1 through 5, plus pages 8 and 10.

Can JPedal convert password-protected PDF files?

Yes. Call convert.setPassword("yourPassword") before openPDFFile().

How do I generate thumbnails from a PDF?

All conversion methods accept either a float scaling value or a new int[] {width, height} array to constrain output dimensions. The fit-to-size option preserves aspect ratio — the output will be at most the specified width or height, whichever dimension is reached first.

What is the difference between ConvertPagesToImages and ConvertPagesToHiResImages?

ConvertPagesToImages covers the most common conversion use cases. ConvertPagesToHiResImages provides additional options for upscaling and fine-grained output control via JPedalSettings. Use it when output quality at large dimensions is critical.

Can I convert PDFs to images without writing Java code?

Yes. JPedal includes a command-line interface: java -jar jpedal.jar --convert "inputFile" "outputDir" jpg. This also allows invocation from any language that supports child processes, including Python, Node.js, C#, and shell scripts.

Does JPedal require any third-party libraries for PDF to image conversion?

No. JPedal is a 100% Java solution with no third-party dependencies. There are no native binaries, no ImageMagick, and no Ghostscript required.

What Java version is required?

JPedal requires Java 17 as a minimum. A separate Java 8 build is available for projects that cannot upgrade — see Which Java versions does JPedal support?

Can I control JPEG compression quality on the output images?

Yes. Use JpegEncoderOptions and call options.setQuality(90) before writing. The default is 75; 100 applies no compression.


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