{"record":{"id":"b9803627e2aa60e4","repo":"mozilla/pdf.js","slug":"app-frompdfconverters-is-read-only","errorCode":null,"errorMessage":"app.fromPDFConverters is read-only","messagePattern":"app\\.fromPDFConverters is read-only","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/scripting_api/app.js","lineNumber":238,"sourceCode":"  set focusRect(val) {\n    /* TODO or not */\n    this._focusRect = val;\n  }\n\n  get formsVersion() {\n    return FORMS_VERSION;\n  }\n\n  set formsVersion(_) {\n    throw new Error(\"app.formsVersion is read-only\");\n  }\n\n  get fromPDFConverters() {\n    return [];\n  }\n\n  set fromPDFConverters(_) {\n    throw new Error(\"app.fromPDFConverters is read-only\");\n  }\n\n  get fs() {\n    return (this._fs ??= new Proxy(\n      new FullScreen({ send: this._send }),\n      this._proxyHandler\n    ));\n  }\n\n  set fs(_) {\n    throw new Error(\"app.fs is read-only\");\n  }\n\n  get language() {\n    return this._language;\n  }\n\n  set language(_) {","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/mozilla/pdf.js/blob/5903d58d58e4dd9ce6ffa3834aea8480f06b4ada/src/scripting_api/app.js#L220-L256","documentation":"app.fromPDFConverters is a stub returning an empty array (PDF.js has no registered PDF import converters). Per the Acrobat JS API the list is viewer-managed, so the setter throws. Assignment is rejected unconditionally.","triggerScenarios":"PDF JavaScript or caller executes app.fromPDFConverters = [...]; the setter at src/scripting_api/app.js:238 throws regardless of argument.","commonSituations":"Scripts that try to register custom converter plugins; confusion with an extensible plugin registry.","solutions":["Do not assign to app.fromPDFConverters; treat it as a viewer-provided (here empty) list.","Implement any conversion outside the scripting API if needed.","Read the property to confirm no converters are available before falling back."],"exampleFix":"// before\napp.fromPDFConverters = [myConverter];\n// after\nconst converters = app.fromPDFConverters; // always [] in pdf.js","handlingStrategy":"validation","validationCode":"// fromPDFConverters always returns [] in pdf.js; just read it.\nconst converters = Array.isArray(app.fromPDFConverters) ? app.fromPDFConverters : [];","typeGuard":"const isEmptyViewerList = (v) => Array.isArray(v) && v.length === 0;","tryCatchPattern":"try { /* code that may assign app.fromPDFConverters */ }\ncatch (e) { if (!/fromPDFConverters is read-only/.test(e.message)) throw e; }","preventionTips":["Treat all viewer-list properties (fromPDFConverters, plugins, monitors, printers) as read-only.","Do not push into the returned array expecting persistence.","Implement converters outside the scripting API."],"tags":["scripting-api","read-only","stub","acrobat-js"],"backgroundTag":null,"analyzedSha":"5903d58d58e4dd9ce6ffa3834aea8480f06b4ada","analyzedAt":"2026-08-13T02:28:27.364Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}