mozilla/pdf.js · error · FormatError

getEexecBlock - no font program found.

Error message

getEexecBlock - no font program found.

What it means

Error "getEexecBlock - no font program found." thrown in mozilla/pdf.js.

Source

Thrown at src/core/type1_font.js:144

}

function getEexecBlock(stream, suggestedLength) {
  // We should ideally parse the eexec block to ensure that `suggestedLength`
  // is correct, so we don't truncate the block data if it's too small.
  // However, this would also require checking if the fixed-content portion
  // exists (using the 'Length3' property), and ensuring that it's valid.
  //
  // Given that `suggestedLength` almost always is correct, all the validation
  // would require a great deal of unnecessary parsing for most fonts.
  // To save time, we always fetch the entire stream instead, which also avoid
  // issues if `suggestedLength` is huge (see comment in `getHeaderBlock`).
  //
  // NOTE: This means that the function can include the fixed-content portion
  // in the returned eexec block. In practice this does *not* seem to matter,
  // since `Type1Parser_extractFontProgram` will skip over any non-commands.
  const eexecBytes = stream.getBytes();
  if (eexecBytes.length === 0) {
    throw new FormatError("getEexecBlock - no font program found.");
  }
  return {
    stream: new Stream(eexecBytes),
    length: eexecBytes.length,
  };
}

// Detects the CID-keyed Type 1 format (Adobe TechNote 5014, CIDFontType 0).
// Caller must additionally check `properties.composite`, since only composite
// fonts are wrapped as CIDFontType0 in PDF.
function isCidKeyedType1File(file) {
  const sample = file.peekBytes(2048);
  if (sample.length < 2 || sample[0] !== 0x25 || sample[1] !== 0x21) {
    return false;
  }
  const text = bytesToString(sample);
  return text.includes("Resource-CIDFont") || /\/CIDFontType\s+0\b/.test(text);
}

View on GitHub (pinned to 5903d58d58)

Solutions

  1. Ensure the Type1 font file actually contains an eexec-encrypted portion; the font program is missing or the font data is truncated.
  2. Replace the embedded font with a valid Type1 font program.

When it happens

Trigger: Thrown at src/core/type1_font.js:144 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of mozilla/pdf.js@5903d58d58 (2026-08-13). Data as JSON: /api/errors/f9ef8a26f0b9cef2. Report an issue: GitHub.