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.

while (this.stateStack.length || this.current.activeSMask !== null) {
        this.restore();
      }
      this.ctx.restore();
      if (this.transparentCanvas) {
        this.ctx = this.compositeCtx;
        this.ctx.save();
        this.ctx.setTransform(1, 0, 0, 1, 0, 0); 
        this.ctx.drawImage(this.transparentCanvas, 0, 0);
        this.ctx.restore();
        this.transparentCanvas = null;
      }
      this.cachedCanvases.clear();
      if (this.imageLayer) {
        this.imageLayer.endLayout();
      }
    }
    
    setLineWidth(width) {
      this.current.lineWidth = width;
      this.ctx.lineWidth = width;
    }
    setLineCap(style) {