{"record":{"id":"a8ccbdd037b187a0","repo":"mozilla/pdf.js","slug":"type3-font-load-error-reason","errorCode":null,"errorMessage":"Type3 font load error: ${reason}","messagePattern":"Type3 font load error: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"src/core/evaluator.js","lineNumber":1395,"sourceCode":"    }\n\n    // Keep track of each font we translated so the caller can\n    // load them asynchronously before calling display on a page.\n    font.loadedName = `${this.idFactory.getDocId()}_${fontID}`;\n\n    this.translateFont(preEvaluatedFont)\n      .then(async translatedFont => {\n        const translated = new TranslatedFont({\n          loadedName: font.loadedName,\n          font: translatedFont,\n          dict: font,\n        });\n\n        if (translatedFont.isType3Font) {\n          try {\n            await translated.loadType3Data(this, resources, task, seenRefs);\n          } catch (reason) {\n            throw new Error(`Type3 font load error: ${reason}`);\n          }\n        }\n        resolve(translated);\n      })\n      .catch(reason => {\n        // TODO reject?\n        warn(`loadFont - translateFont failed: \"${reason}\".`);\n\n        resolve(\n          new TranslatedFont({\n            loadedName: font.loadedName,\n            font: new ErrorFont(reason?.message),\n            dict: font,\n          })\n        );\n      });\n    return promise;\n  }","sourceCodeStart":1377,"sourceCodeEnd":1413,"githubUrl":"https://github.com/mozilla/pdf.js/blob/5903d58d58e4dd9ce6ffa3834aea8480f06b4ada/src/core/evaluator.js#L1377-L1413","documentation":"Raised internally when loadType3Data fails for a Type3 font whose CharProcs cannot be evaluated. Crucially, this throw happens inside translateFont's .then() and is caught by the chained .catch(), which resolves the loadFont promise with an ErrorFont fallback instead of rejecting. The API caller therefore never observes a thrown error; the symptom is missing/blank glyphs rendered with the fallback font and a console warning ('loadFont - translateFont failed').","triggerScenarios":"A page uses a Type3 font whose CharProcs stream references undefined operators, missing or invalid resources, unreadable images, or itself recursively; loadType3Data (which re-evaluates each glyph's operator list) then throws.","commonSituations":"Specialty/scientific PDFs, LaTeX/TeX-derived Type3 fonts, or PDFs from generators that emit incomplete Type3 font resource dictionaries. Often seen together with errors in image or colorspace parsing of the glyph procs.","solutions":["Treat it as non-fatal: it already falls back to ErrorFont, so rendering continues; rely on ignoreErrors for surrounding operators if needed.","Inspect the font dictionary's CharProcs and Resources entries to confirm required XObject/ColorSpace/Font sub-resources are present and valid.","Upgrade PDF.js, since Type3 evaluation changes over time.","Re-embed the font as a standard/CFF/TrueType font in the source document to avoid Type3 entirely."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// No catch needed: PDF.js already resolves loadFont with an ErrorFont fallback.\n// Detect the fallback instead and surface a UI hint if you care about glyph fidelity.\nconst fontIds = await page.getOperatorList?.(); // fonts are loaded internally\n// If glyphs render blank, the Type3 font fell back; treat as cosmetic, not fatal.","preventionTips":["Do not treat 'Type3 font load error' console output as a fatal render failure; rendering continues.","If glyph fidelity matters (signatures, logos), re-embed the font as a non-Type3 font in the source.","Keep ignoreErrors enabled around rendering so a bad glyph proc does not cascade."],"tags":["pdf","font","type3-font","fallback","rendering"],"backgroundTag":null,"analyzedSha":"5903d58d58e4dd9ce6ffa3834aea8480f06b4ada","analyzedAt":"2026-08-13T02:28:27.364Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}