PDF header at the beginning of the file
25 50 44 46 2D 31 2E 37The bytes above are ASCII %PDF-1.7. The five-character prefix %PDF- is fixed; the version digits vary. The first line terminates with a carriage return, line feed, or both.
Core PDF structures
| Structure | Typical token | Role |
|---|---|---|
| Header | %PDF-1.x | Declares the file format and header version |
| Indirect object | n g obj … endobj | Stores dictionaries, arrays, streams, pages, and other values |
| Stream | stream … endstream | Contains byte data that may use one or more filters |
| Cross-reference | xref or XRef stream | Maps object numbers to file positions or compressed locations |
| Trailer data | trailer or XRef dictionary | Identifies the document catalog and related metadata |
| Final pointer | startxref | Points to the latest cross-reference section or stream |
| End marker | %%EOF | Marks the end of a PDF revision |
Read the file from the end
A conventional PDF trailer is followed by startxref, a decimal byte offset, and %%EOF. PDF 1.5 and later can place trailer entries inside a cross-reference stream instead of using the literal xref and trailer keywords.
Incremental updates append changed objects and a new cross-reference section rather than rewriting the whole document. A valid updated file can therefore contain several %%EOF markers; the final revision is the relevant entry point.
Practical PDF inspection checks
- Confirm the ASCII
%PDF-header and version token. - Search for
startxrefand compare its number with the target byte offset. - Expect streams to contain compressed or otherwise filtered bytes, not only readable text.
- Account for incremental revisions before treating duplicate objects as corruption.
- Use a sandboxed, format-aware parser for security-sensitive validation.
Local processing and privacy
The PDF file format workflow opens the same Bitpeek browser workspace. Selected file bytes, file names, pasted input, searches, edits, hashes, and comparison data are processed in local browser memory and are not sent to a Bitpeek server.
The static guide itself can be read without opening a file or creating an account.
Technical reference: Adobe PDF 32000-1:2008 specification.
Frequently asked questions
Is all PDF content readable as text?
No. PDF syntax contains readable tokens, but stream data is often compressed, encoded, encrypted, or binary.
Why can a PDF contain more than one %%EOF marker?
Incremental updates append a complete new revision trailer and EOF marker while preserving earlier bytes.
Does the header version always control features?
Not always. Starting with PDF 1.4, the document catalog may contain a Version entry that supersedes the header value.