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…
Latest posts by Bethan Palmer (see all)
- How to read PNG files in Java - February 23, 2017
- Speed Comparisons of Java Image Libraries: ImageIO, JAI & JDeli - February 21, 2017
- Back to Basics: The 2017 Guide to to PDF Files – Extracting images from PDF files - February 2, 2017
- Back to Basics: The 2017 Guide to to PDF Files – Converting PDF files to images - January 31, 2017
- Interesting PDF bugs – Nasty Java JVM bug (revisited) - December 6, 2016