mozilla/pdf.js · error · FormatError

Invalid getTilingPatternIR /PaintType value.

Error message

Invalid getTilingPatternIR /PaintType value.

What it means

Error "Invalid getTilingPatternIR /PaintType value." thrown in mozilla/pdf.js.

Source

Thrown at src/core/pattern.js:1262

function getTilingPatternIR(operatorList, dict, color, needsIsolation = true) {
  const matrix = lookupMatrix(dict.getArray("Matrix"), IDENTITY_MATRIX);
  const bbox = lookupNormalRect(dict.getArray("BBox"), null);
  // Ensure that the pattern has a non-zero width and height, to prevent errors
  // in `pattern_helper.js` (fixes issue8330.pdf).
  if (!bbox || bbox[2] - bbox[0] === 0 || bbox[3] - bbox[1] === 0) {
    throw new FormatError(`Invalid getTilingPatternIR /BBox array.`);
  }
  const xstep = dict.get("XStep");
  if (typeof xstep !== "number") {
    throw new FormatError(`Invalid getTilingPatternIR /XStep value.`);
  }
  const ystep = dict.get("YStep");
  if (typeof ystep !== "number") {
    throw new FormatError(`Invalid getTilingPatternIR /YStep value.`);
  }
  const paintType = dict.get("PaintType");
  if (!Number.isInteger(paintType)) {
    throw new FormatError(`Invalid getTilingPatternIR /PaintType value.`);
  }
  const tilingType = dict.get("TilingType");
  if (!Number.isInteger(tilingType)) {
    throw new FormatError(`Invalid getTilingPatternIR /TilingType value.`);
  }

  return [
    "TilingPattern",
    color,
    operatorList,
    matrix,
    bbox,
    xstep,
    ystep,
    paintType,
    tilingType,
    needsIsolation,
  ];

View on GitHub (pinned to 5903d58d58)

Solutions

  1. Set /PaintType in the tiling pattern dictionary to 1 (colored) or 2 (uncolored/stencil); any other value is invalid.

When it happens

Trigger: Thrown at src/core/pattern.js:1262 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/d9b3face8812c5c6. Report an issue: GitHub.