diff --git a/pdf.js b/pdf.js index 378c17580..440385563 100644 --- a/pdf.js +++ b/pdf.js @@ -5649,8 +5649,9 @@ var CanvasGraphics = (function canvasGraphics() { var tmpCtx = tmpCanvas.getContext('2d'); if (imageObj.imageMask) { var fillColor = this.current.fillColor; - tmpCtx.fillStyle = (fillColor && fillColor.type === 'Pattern') ? - fillColor.getPattern(tmpCtx) : fillColor; + tmpCtx.fillStyle = (fillColor && fillColor.hasOwnProperty('type') && + fillColor.type === 'Pattern') ? + fillColor.getPattern(tmpCtx) : fillColor; tmpCtx.fillRect(0, 0, w, h); } var imgData = tmpCtx.getImageData(0, 0, w, h);