{"record":{"id":"7ad3c0ea44f00315","repo":"mozilla/pdf.js","slug":"unhandled-xobject-subtype-type-name","errorCode":null,"errorMessage":"Unhandled XObject subtype ${type.name}","messagePattern":"Unhandled XObject subtype (.+?)","errorType":"exception","errorClass":"FormatError","httpStatus":null,"severity":"error","filePath":"src/core/evaluator.js","lineNumber":1837,"sourceCode":"                  return;\n                } else if (type.name === \"Image\") {\n                  self\n                    .buildPaintImageXObject({\n                      resources,\n                      image: xobj,\n                      operatorList,\n                      cacheKey: name,\n                      localImageCache,\n                      localColorSpaceCache,\n                    })\n                    .then(resolveXObject, rejectXObject);\n                  return;\n                } else if (type.name === \"PS\") {\n                  // PostScript XObjects are unused when viewing documents.\n                  // See section 4.7.1 of Adobe's PDF reference.\n                  info(\"Ignored XObject subtype PS\");\n                } else {\n                  throw new FormatError(\n                    `Unhandled XObject subtype ${type.name}`\n                  );\n                }\n                resolveXObject();\n              }).catch(function (reason) {\n                if (reason instanceof AbortException) {\n                  return;\n                }\n                if (self.options.ignoreErrors) {\n                  warn(`getOperatorList - ignoring XObject: \"${reason}\".`);\n                  return;\n                }\n                throw reason;\n              })\n            );\n            return;\n          case OPS.setFont:\n            const fontSize = args[1];","sourceCodeStart":1819,"sourceCodeEnd":1855,"githubUrl":"https://github.com/mozilla/pdf.js/blob/5903d58d58e4dd9ce6ffa3834aea8480f06b4ada/src/core/evaluator.js#L1819-L1855","documentation":"FormatError thrown when an XObject's Subtype Name is a value other than Form, Image, or PS. PDF.js dispatches Image (buildImage), Form (buildFormXObject), and PS (ignored with an info log); any other subtype name is unsupported.","triggerScenarios":"An XObject stream carries a Subtype Name that is not /Form, /Image, or /PS (e.g. a custom or future/unknown subtype).","commonSituations":"Non-standard or experimental XObject subtypes, or PDFs from tools that emit vendor-specific subtypes.","solutions":["Enable ignoreErrors: true so the unsupported XObject is skipped.","Repair/convert the PDF to use standard /Form, /Image, or /PS subtypes.","Upgrade PDF.js in case support was added."],"exampleFix":"// before\ngetDocument({ data }); // unsupported XObject subtype aborts\n\n// after\ngetDocument({ data, ignoreErrors: true }); // unsupported subtype skipped","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await page.render({ canvasContext, viewport }).promise;\n} catch (e) {\n  if (/Unhandled XObject subtype/.test(e.message)) {\n    await reloadWith({ ignoreErrors: true });\n  } else throw e;\n}","preventionTips":["Enable ignoreErrors for untrusted PDFs.","Convert non-standard XObject subtypes to /Form, /Image, or /PS in source PDFs.","Upgrade PDF.js for new subtype support."],"tags":["pdf","xobject","malformed-pdf","rendering"],"backgroundTag":null,"analyzedSha":"5903d58d58e4dd9ce6ffa3834aea8480f06b4ada","analyzedAt":"2026-08-13T02:28:27.364Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}