Do you need an image that big in your PDF file

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!

Related Posts:

The following two tabs change content below.

Mark Stephens

System Architect and Lead Developer at IDRSolutions
Mark Stephens has been working with Java and PDF since 1999 and has diversified into HTML5, SVG and JavaFX. He also enjoys speaking at conferences and has been a Speaker at user groups, Business of Software, Seybold and JavaOne conferences. He has a very dry sense of humor and an MA in Medieval History for which he has not yet found a practical use.
Markee174

About Mark Stephens

Mark Stephens has been working with Java and PDF since 1999 and has diversified into HTML5, SVG and JavaFX.

He also enjoys speaking at conferences and has been a Speaker at user groups, Business of Software, Seybold and JavaOne conferences. He has a very dry sense of humor and an MA in Medieval History for which he has not yet found a practical use.

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>