{"record":{"id":"e48e54439a3a2938","repo":"mozilla/pdf.js","slug":"unknown-patternname-patternname","errorCode":null,"errorMessage":"Unknown PatternName: ${patternName}","messagePattern":"Unknown PatternName: (.+?)","errorType":"exception","errorClass":"FormatError","httpStatus":null,"severity":"error","filePath":"src/core/evaluator.js","lineNumber":1667,"sourceCode":"          );\n        } else if (typeNum === PatternType.SHADING) {\n          const shading = dict.get(\"Shading\");\n          const objId = this.parseShading({\n            shading,\n            resources,\n            localColorSpaceCache,\n            localShadingPatternCache,\n          });\n          if (objId) {\n            const matrix = lookupMatrix(dict.getArray(\"Matrix\"), null);\n            operatorList.addOp(fn, [\"Shading\", objId, matrix]);\n          }\n          return undefined;\n        }\n        throw new FormatError(`Unknown PatternType: ${typeNum}`);\n      }\n    }\n    throw new FormatError(`Unknown PatternName: ${patternName}`);\n  }\n\n  async parseMarkedContentProps(contentProperties, resources) {\n    return parseMarkedContentProps(this.xref, contentProperties, resources);\n  }\n\n  async getOperatorList({\n    stream,\n    task,\n    resources,\n    operatorList,\n    initialState = null,\n    fallbackFontDict = null,\n    prevRefs = null,\n  }) {\n    if (stream.isAsync) {\n      const bytes = await stream.asyncGetBytes();\n      if (bytes) {","sourceCodeStart":1649,"sourceCodeEnd":1685,"githubUrl":"https://github.com/mozilla/pdf.js/blob/5903d58d58e4dd9ce6ffa3834aea8480f06b4ada/src/core/evaluator.js#L1649-L1685","documentation":"FormatError thrown when a pattern referenced by name cannot be resolved at all: the name is absent from the page/resources Pattern dictionary and xref.fetchIfRef returns nothing. It means the content stream names a pattern that does not exist in the resource chain.","triggerScenarios":"A setFillColorN/setStrokeColorN operator uses a /Pattern color space and names a pattern that is not present in the current resources' Pattern dict (typo, missing entry, or wrong resource scope).","commonSituations":"PDFs whose resource dictionaries were stripped or merged incorrectly, renamed pattern names, or content streams moved between pages without updating resources.","solutions":["Enable ignoreErrors: true so the missing pattern degrades to a warning.","Repair the PDF: add the missing Pattern entry or fix the referenced name.","Verify the resources object passed to getOperatorList is the correct one for that content stream."],"exampleFix":"// before\ngetDocument({ data }); // render aborts: Unknown PatternName\n\n// after\ngetDocument({ data, ignoreErrors: true }); // missing pattern skipped","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await page.render({ canvasContext, viewport }).promise;\n} catch (e) {\n  if (/Unknown PatternName/.test(e.message)) {\n    await reloadWith({ ignoreErrors: true });\n  } else throw e;\n}","preventionTips":["Use ignoreErrors:true for untrusted PDFs.","Repair PDFs whose resource dictionaries reference missing pattern names.","Log affected pages to identify systematically broken source documents."],"tags":["pdf","pattern","color","malformed-pdf","rendering"],"backgroundTag":null,"analyzedSha":"5903d58d58e4dd9ce6ffa3834aea8480f06b4ada","analyzedAt":"2026-08-13T02:28:27.364Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}