If you examine the contents in the first few byes of a PDF file, you will see the PDF format version listed. E.g. you will see something such as the following:
Hex: 25 50 44 46 2D 31 2E
ASCII: %PDF-1.
The bytes shown might be %PDF-1.4
(Hex 25 50 44 46 2D 31 2E
34), if the version is 1.4.
But there are cases where the information in the first few bytes of the file can be overridden by information appearing later in the file. Derek Clegg states at Re: How do you determine PDF version that "The version of a PDF file isn't solely determined by the first few bytes of the PDF; in PDF 1.4 and later, the version specified at the start of the PDF file can be overridden by a / Version entry in the document's catalog. (See section 3.4.1 of the PDF 1.5 specification for more info.) This is why Quartz PDF files always start with %PDF-1.3 but may, in fact, be PDF 1.4 or later."
The PDF version number determines features incorporated into the format. For instance version 1.4 was the first first to support transparency and metadata. Some older PDF viewers may not be able to view PDF files written in a newer PDF format. A listing of versions and features is available at Create better PDFs by understanding the formats.
On a Unix or Linux system, you can use the od
command to view
the first few bytes of a PDF file.
# od -c -N 10 EBIA_ERISA_3rdQtr2007.pdf
0000000 % P D F - 1 . 4 \n %
0000012
The \n
that appears after the "1.4" is just a newline character.
Though Windows doesn't come with a hexadecimal editor, there are free hexadecimal editors available for Windows systems as well that will allow you to view those first few bytes in the PDF file.
References:
-
PDF Developer Center: PDF reference
Adobe Systems Incorporated -
Re: How do you determine PDF version?
By: Derek Clegg
Date: February 21, 2006
Apple Mailing Lists -
Create better PDFs by understanding the formats
By James Dempsey
December 14, 2006
Creative Guy