From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "behavior" |
|---|
| subject | "Format:PDF" |
|---|
| claim | "qpdf looks for the linearization dictionary in the first 1024 bytes: the first object there must have /Linearized 1 and an /L equal to the actual file length, otherwise the file is not treated as linearized (it is read as an ordinary PDF). It then reads /H [hint offset, hint length] or, with an overflow hint table, 4 integers (any other count is an error), /O first page object, /E end of first page, /N page count (must equal the real page count or linearization data is rejected), /T offset of the main xref table's first entry, and an optional /P first page number." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "linearized PDF files" |
|---|
| observed_in | |
|---|
|
|---|
| data | | trigger | "reading the first object of a linearized PDF" |
|---|
| effect | "/Linearized (1) and /L (file length) decide whether the file counts as linearized; then /H (array of 2 or 4 integers), /O, /E, /N (must match the page count), /T and optional /P are read" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "isLinearized: /Linearized == 1, /L == file size; readLinearizationData reads H O E N T P" |
|---|
| repo | "https://github.com/qpdf/qpdf" |
|---|
| commit | "4eba95899886e851cc41d76886483b347612f2a8" |
|---|
| path | "libqpdf/QPDF_linearization.cc" |
|---|
| lines | "527-567" |
|---|
|
| type | "source" |
|---|
| detail | "Read Lin::linearized (reads 1024 bytes, scans for an object header, tests /Linearized == 1 and /L == file size) and readLinearizationData (H size 2 or 4, N != pages.size() error)." |
|---|
| repo | "https://github.com/qpdf/qpdf" |
|---|
| commit | "4eba95899886e851cc41d76886483b347612f2a8" |
|---|
| path | "libqpdf/QPDF_linearization.cc" |
|---|
| lines | "495-600" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "Linearization parameter dictionary" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-18T23:42:37.862Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T08:48:13.336Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read Lin::linearized and readLinearizationData in qpdf QPDF_linearization.cc at 4eba958: 1024-byte window, first 'N G obj' header, /Linearized floor == 1, /L == file size else return false; H size 2 or 4, /N must equal page count, /P optional." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T04:48:46.545Z" |
|---|
| summary | "Add conditions qpdf checks: dictionary within first 1024 bytes, /L mismatch makes the file simply not linearized, /N must equal the page count, /H of 2 or 4 items. Read Lin::linearized and…" |
|---|
| changed | | "claim" |
| "data" |
| "evidence" |
|
|---|
|
|
|---|