code: function (format, multiplier, quality) {
  
        var origWidth = this.getWidth(),
            origHeight = this.getHeight(),
            scaledWidth = origWidth * multiplier,
            scaledHeight = origHeight * multiplier,
            activeObject = this.getActiveObject(),
            activeGroup = this.getActiveGroup();
  
        this.setWidth(scaledWidth).setHeight(scaledHeight);
        this.contextTop.scale(multiplier, multiplier);
  
        if (activeGroup) {
          // not removing group due to complications with restoring it with correct state afterwords
          this._tempRemoveBordersCornersFromGroup(activeGroup);
        }
        else if (activeObject) {
          this.deactivateAll();
        }
  
        // restoring width, height for `renderAll` to draw
        // background properly (while context is scaled)
        this.width = origWidth;
        this.height = origHeight;
  
        this.renderAll(true);
  
        var dataURL = this.toDataURL(format, quality);
  
        this.contextTop.scale(1 / multiplier,  1 / multiplier);
        this.setWidth(origWidth).setHeight(origHeight);
  
        if (activeGroup) {
          this._restoreBordersCornersOnGroup(activeGroup);
        }
        else if (activeObject) {
          this.setActiveObject(activeObject);
        }
  
        this.renderAll();
  
        return dataURL;
      }
docs: Exports canvas element to a dataurl image (allowing to change image size via multiplier).
  @method toDataURLWithMultiplier
  @param {String} format (png|jpeg)
  @param {Number} multiplier
  @param {Number} quality (0..1)
  @return {String}