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.

if (width < measuredWidth && this.isFontSubpixelAAEnabled) {
            const characterScaleX = width / measuredWidth;
            restoreNeeded = true;
            ctx.save();
            ctx.scale(characterScaleX, 1);
            scaledX /= characterScaleX;
          } else if (width !== measuredWidth) {
            scaledX +=
              (((width - measuredWidth) / 2000) * fontSize) / fontSizeScale;
          }
        }
        
        
        if (this.contentVisible && (glyph.isInFont || font.missingFile)) {
          if (simpleFillText && !accent) {
            
            ctx.fillText(character, scaledX, scaledY);
          } else {
            this.paintChar(
              character,
              scaledX,
              scaledY,
              patternTransform,
              resetLineWidthToOne
            );
            if (accent) {
              const scaledAccentX =
                scaledX + (fontSize * accent.offset.x) / fontSizeScale;
              const scaledAccentY =
                scaledY - (fontSize * accent.offset.y) / fontSizeScale;