Site iconJava PDF Blog

How do I find the PDF version used (Tutorial)

There have been several revisions of the PDF file specification, each backward compatible but adding new features. For example, the PDF format version 1.6 added a new way to squash down data and reduce the size of files. The current latest version is 2.0 and while it may work in libraries which do not support 2.0, there is no guarantee.

How to find out the PDF version in Acrobat

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

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

JPedal PDF preferences

How to find the PDF version in a text editor

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

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 to check PDF version history.

How to find the PDF version using code in Java

Java has no support for PDF files so you will need a third-party library such as JPedal which provide this functionality.