Back to Basics: The 2017 Guide to to PDF Files – Converting PDF files to images

Last week we looked at text handling and structured text in PDF files. This week I will be looking at images in PDFs.

One of the most popular features of our Java PDF library, JPedal, is PDF to image conversion. This allows you to convert PDF files to PNG, JPEG or TIFF.

Why Convert PDF Files to Image?

Images are non-editable, pixelate, are larger and non-searchable. So why would you want to convert PDF files to images?

The answer is that you might not want to display your file with PDF display tools. You might want to display the content in a browser (one increasingly popular solution to this is our PDF to HTML5 converter). Or you might want to use an image of the PDF file as a thumbnail.

These two use cases require different size images. So one of the things we needed to consider with PDF2Image was, how big to make the output?

There has to be a balancing act when choosing the size of the image output. If it is too large, more memory will be used and the conversion will take longer. Therefore our default mode is to convert the image to the size of a PDF file. This is what our example conversion does. But some people might want a larger image, which will have more detail and allow you to zoom in and retain the quality. Therefore we also have an option to convert pages to hi res images. For files with high quality images, the time and memory increase might be worth the trade-off. You can read more about this in our previous article on PDF to image conversion in Java.

More information about how we overcame the problem of retaining image quality can be found in our article about PDF to image quality. If you have read this you will know that the PDF file format often uses vector graphics, and converting to bitmap can result in a loss of quality. This is because a line cannot be half a pixel wide, it can only be on or off. We have different solutions to this problem depending on the use case. Each comes with a compromise. For example scaling up the image output will give a higher quality result, but will use more time and memory.

So there are a range of possible factors to consider when converting PDF to image. Our library comes with extensive documentation to enable you to choose the most appropriate solution.

Now you know all about converting PDF files to images, and in my next post I will be showing you how to make better use of the images inside PDF files…

If you’re a first-time reader, or simply want to be notified when we post new articles and updates, you can keep up to date by social media (Twitter,FacebookandGoogle+) or the Blog RSS.

Related Posts:

The following two tabs change content below.

Bethan Palmer

Developer at IDR Solutions
Bethan is a Java developer at IDR Solutions and was a speaker at JavaOne 2016. She has a degree in English Literature and in her spare time enjoys sports including running and handball.
Bethan

About Bethan Palmer

Bethan is a Java developer at IDR Solutions and was a speaker at JavaOne 2016. She has a degree in English Literature and in her spare time enjoys sports including running and handball.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>