PDF.js displays blurry plots in PDF documents, e.g.

http://arxiv.org/pdf/1202.5344v1.pdf

When viewed in Chrome or Adobe Acrobat all the plots show sharp-edged squares. When viewed in Preview or PDF.js, all the squares show as blurry pixelated blobs.

this.ctx.canvas.width,
      combinedScale[0]
    );
    const dimy = this.getSizeAndScale(
      ystep,
      this.ctx.canvas.height,
      combinedScale[1]
    );
    const tmpCanvas = owner.cachedCanvases.getCanvas(
      "pattern",
      dimx.size,
      dimy.size,
      true
    );
    const tmpCtx = tmpCanvas.context;
    const graphics = canvasGraphicsFactory.createCanvasGraphics(tmpCtx);
    graphics.groupLevel = owner.groupLevel;
    this.setFillAndStrokeStyleToContext(graphics, paintType, color);
    graphics.transform(dimx.scale, 0, 0, dimy.scale, 0, 0);
    this.clipBbox(graphics, bbox, x0, y0, x1, y1);
    graphics.baseTransform = graphics.ctx.mozCurrentTransform.slice();
    graphics.executeOperatorList(operatorList);
    graphics.endDrawing();
    return {
      canvas: tmpCanvas.canvas,
      scaleX: dimx.scale,
      scaleY: dimy.scale,
    };
  }
  getSizeAndScale(step, realOutputSize, scale) {