mozilla/pdf.js · warning · FormatError
The Linearization dictionary doesn't point to a valid Page d
Error message
The Linearization dictionary doesn't point to a valid Page dictionary.
What it means
FormatError thrown by _getLinearizationPage when the object referenced by the linearization dictionary's H array (or page reference) is not a valid Page dictionary (not a Dict, or missing Type=Page / Contents without Kids). It is wrapped in a try/catch: the message is logged as a warning and pdf.js falls back to catalog.getPageDict, so end users usually never see the raw error.
Source
Thrown at src/core/document.js:1683
if (type instanceof Ref) {
type = await xref.fetchAsync(type);
}
if (
isName(type, "Page") ||
(!obj.has("Type") && !obj.has("Kids") && obj.has("Contents"))
) {
if (!catalog.pageKidsCountCache.has(ref)) {
catalog.pageKidsCountCache.put(ref, 1); // Cache the Page reference.
}
// Help improve performance of the `Catalog.getPageIndex` method.
if (!catalog.pageIndexCache.has(ref)) {
catalog.pageIndexCache.put(ref, 0);
}
return [obj, ref];
}
}
throw new FormatError(
"The Linearization dictionary doesn't point to a valid Page dictionary."
);
} catch (reason) {
warn(`_getLinearizationPage: "${reason.message}".`);
return catalog.getPageDict(pageIndex);
}
}
getPage(pageIndex) {
const cachedPromise = this.#pagePromises.get(pageIndex);
if (cachedPromise) {
return cachedPromise;
}
const { catalog, linearization, xfaFactory } = this;
let promise;
if (xfaFactory) {
promise = Promise.resolve([Dict.empty, null]);View on GitHub (pinned to 5903d58d58)
Solutions
- Re-linearize with qpdf --linearize or Acrobat's Save As Optimized.
- If you control delivery, ensure the byte range serving (Range requests) returns the full linearization section.
- Suppress the warning in logs if recovery is working—the viewer will still render via the catalog fallback.
Defensive patterns
Strategy: fallback
Prevention
- This error is internally caught and recovered; no caller action needed beyond accepting the recovery.
- Re-linearize suspect PDFs with qpdf --linearize to silence the warning.
- Ensure Range requests serve the full linearization section for byte-served PDFs.
When it happens
Trigger: A 'linearized' PDF whose hint table points to a non-Page object; a corrupt linearization header; a producer that wrote a linearization dict without proper Page references.
Common situations: Bad linearization from buggy producers or aggressive PDF optimizers; partially downloaded linearized PDFs where the referenced object is missing.
Related errors
- Page count is not an integer.
- unknown encryption method
- unsupported encryption algorithm
- invalid key length
- Invalid crypt filter name.
AI-assisted analysis of mozilla/pdf.js@5903d58d58 (2026-08-13).
Data as JSON: /api/errors/5fd139f9bbb70540.
Report an issue: GitHub.