{"record":{"id":"5fd139f9bbb70540","repo":"mozilla/pdf.js","slug":"the-linearization-dictionary-doesn-t-point-to-a-va","errorCode":null,"errorMessage":"The Linearization dictionary doesn't point to a valid Page dictionary.","messagePattern":"The Linearization dictionary doesn't point to a valid Page dictionary\\.","errorType":"exception","errorClass":"FormatError","httpStatus":null,"severity":"warning","filePath":"src/core/document.js","lineNumber":1683,"sourceCode":"        if (type instanceof Ref) {\n          type = await xref.fetchAsync(type);\n        }\n        if (\n          isName(type, \"Page\") ||\n          (!obj.has(\"Type\") && !obj.has(\"Kids\") && obj.has(\"Contents\"))\n        ) {\n          if (!catalog.pageKidsCountCache.has(ref)) {\n            catalog.pageKidsCountCache.put(ref, 1); // Cache the Page reference.\n          }\n          // Help improve performance of the `Catalog.getPageIndex` method.\n          if (!catalog.pageIndexCache.has(ref)) {\n            catalog.pageIndexCache.put(ref, 0);\n          }\n\n          return [obj, ref];\n        }\n      }\n      throw new FormatError(\n        \"The Linearization dictionary doesn't point to a valid Page dictionary.\"\n      );\n    } catch (reason) {\n      warn(`_getLinearizationPage: \"${reason.message}\".`);\n      return catalog.getPageDict(pageIndex);\n    }\n  }\n\n  getPage(pageIndex) {\n    const cachedPromise = this.#pagePromises.get(pageIndex);\n    if (cachedPromise) {\n      return cachedPromise;\n    }\n    const { catalog, linearization, xfaFactory } = this;\n\n    let promise;\n    if (xfaFactory) {\n      promise = Promise.resolve([Dict.empty, null]);","sourceCodeStart":1665,"sourceCodeEnd":1701,"githubUrl":"https://github.com/mozilla/pdf.js/blob/5903d58d58e4dd9ce6ffa3834aea8480f06b4ada/src/core/document.js#L1665-L1701","documentation":"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.","triggerScenarios":"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.","commonSituations":"Bad linearization from buggy producers or aggressive PDF optimizers; partially downloaded linearized PDFs where the referenced object is missing.","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."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["linearization","format-error","recovery","page-loading"],"backgroundTag":null,"analyzedSha":"5903d58d58e4dd9ce6ffa3834aea8480f06b4ada","analyzedAt":"2026-08-13T02:28:27.364Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}