{"record":{"id":"f9ef8a26f0b9cef2","repo":"mozilla/pdf.js","slug":"geteexecblock-no-font-program-found","errorCode":null,"errorMessage":"getEexecBlock - no font program found.","messagePattern":"getEexecBlock - no font program found\\.","errorType":"exception","errorClass":"FormatError","httpStatus":null,"severity":"error","filePath":"src/core/type1_font.js","lineNumber":144,"sourceCode":"}\n\nfunction getEexecBlock(stream, suggestedLength) {\n  // We should ideally parse the eexec block to ensure that `suggestedLength`\n  // is correct, so we don't truncate the block data if it's too small.\n  // However, this would also require checking if the fixed-content portion\n  // exists (using the 'Length3' property), and ensuring that it's valid.\n  //\n  // Given that `suggestedLength` almost always is correct, all the validation\n  // would require a great deal of unnecessary parsing for most fonts.\n  // To save time, we always fetch the entire stream instead, which also avoid\n  // issues if `suggestedLength` is huge (see comment in `getHeaderBlock`).\n  //\n  // NOTE: This means that the function can include the fixed-content portion\n  // in the returned eexec block. In practice this does *not* seem to matter,\n  // since `Type1Parser_extractFontProgram` will skip over any non-commands.\n  const eexecBytes = stream.getBytes();\n  if (eexecBytes.length === 0) {\n    throw new FormatError(\"getEexecBlock - no font program found.\");\n  }\n  return {\n    stream: new Stream(eexecBytes),\n    length: eexecBytes.length,\n  };\n}\n\n// Detects the CID-keyed Type 1 format (Adobe TechNote 5014, CIDFontType 0).\n// Caller must additionally check `properties.composite`, since only composite\n// fonts are wrapped as CIDFontType0 in PDF.\nfunction isCidKeyedType1File(file) {\n  const sample = file.peekBytes(2048);\n  if (sample.length < 2 || sample[0] !== 0x25 || sample[1] !== 0x21) {\n    return false;\n  }\n  const text = bytesToString(sample);\n  return text.includes(\"Resource-CIDFont\") || /\\/CIDFontType\\s+0\\b/.test(text);\n}","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/mozilla/pdf.js/blob/5903d58d58e4dd9ce6ffa3834aea8480f06b4ada/src/core/type1_font.js#L126-L162","documentation":"Error \"getEexecBlock - no font program found.\" thrown in mozilla/pdf.js.","triggerScenarios":"Thrown at src/core/type1_font.js:144 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the Type1 font file actually contains an eexec-encrypted portion; the font program is missing or the font data is truncated.","Replace the embedded font with a valid Type1 font program."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5903d58d58e4dd9ce6ffa3834aea8480f06b4ada","analyzedAt":"2026-08-13T02:28:27.364Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}