We were sent a PDF file last week which was slow and needed a lot of memory to decode. We investigated the file and found that it contained a huge image (6000×6000 pixels). The image data for this was encoded so it meant a big hit decompressing the data, then assembling the image before down-sampling it to appear on an 595×842 page.
Sometimes it is useful to have a large image, because you can then zoom in. But this would need a zoom of 750% to make full use of it. And it turned out it was actually a white box drawn on the screen for background. So you could actually have used a 1×1 pixel image to achieve the same thing.
So if you have control over your PDF files, ask yourself, do I need images that big or is it just bloat?
This post is part of our “Understanding the PDF File Format” series. In each article, we discuss a PDF feature, bug, gotcha or tip. If you wish to learn more about PDF, we have 13 years worth of PDF knowledge and tips, so click here to visit our series index!
Latest posts by Mark Stephens (see all)
- 3 ways that the European Union is changing the way Companies write software in 2018 - January 31, 2018
- IDRsolutions product range update for 2018 - January 22, 2018
- 4 ways Companies can make remote working successful - December 21, 2017
- My experience of a Turkish bath (visiting Istanbul for DevFest) - November 24, 2017
- My 5 key takeaways from JavaOne 2017 - October 6, 2017