How do I find out the PDF version used

There have been several revisions of the PDF file specification, each backward compatible but adding new features. For example, version 1.6 added a new way to squash down data and reduce the size of PDF files. The current latest version is 1.8 and while it may work in libraries which do not support 1.8, there is no guarantee. Sun’s Java PDF Renderer does not support many of the features in versions 1.6 and above which is why it fails on lots of PDF files.

In order to be confident of displaying the PDF file correctly, you obviously need a program which supports that version. With Acrobat it is always one number than the release (so Acrobat 9 supports all versions up to 1.8 while Acrobat 8 only covers up to 1.7). You can see the version number in Acrobat by opening the preferences window and looking at PDF version. This PDF file is version 1.3 so it needs at least Acrobat 4.0

PDF preferences window

PDF preferences window

Most PDF tools have a window to display such information – here is the equivalent in JPedal

JPedal PDF preferences

JPedal PDF preferences

You can also find the version by opening the PDF file in a text editor. Most of the content will look like garbage (and you must not resave the file because you can corrupt it), but the first line always contains the version.

PDF file in text editor

PDF file in text editor

This is very useful if you are writing a program which needs to know the version – you just need to read the first line of the file.

The version is also worth considering when creating PDF files. Many creation tools let you target a certain version. Do you need all the bells and whistles present in version 1.8? Does the PDF look identical if you use version 1.4?

Is there a feature in you consider critical in later versions? What do you think?

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.

3 thoughts on “How do I find out the PDF version used

  1. Jean

    There is no PDF Version 1.8, I had never heard of it. The next Version to be published will be 2.0.

    There must be another place in the pdf file where the version is stored. I got some pdf files which contain Version 1.4 in the first line but Acrobat reader claims they were PDF Version 1.5 (all other tools say 1.4)!

  2. It is the first line in the PDF

    • Jean

      Not completly, there is another location where the version can be stored, there is an optional version tag in the documents catalog which overides the information in the files first line (you can lookup this in the PDF format specification).

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>