- Linting (ESLint): Apply coding standards

- Breaking change (minor): Change export filename to check `exportWindowName` and change default from `download.pdf` to `svg.pdf` to distinguish from other downloads
- Enhancement: Restore old dataURI functionality for non-Chrome browsers
This commit is contained in:
Brett Zamir
2018-09-13 09:13:05 +08:00
parent 1e9b72ef53
commit b0bad24645
3 changed files with 27 additions and 12 deletions

View File

@@ -3956,7 +3956,7 @@ this.rasterExport = function (imgType, quality, exportWindowName, cb) {
* Generates a PDF based on the current image, then calls "exportedPDF" with
* an object including the string, the data URL, and any issues found
* @function module:svgcanvas.SvgCanvas#exportPDF
* @param {string} exportWindowName
* @param {string} exportWindowName Will also be used for the download file name here
* @param {external:jsPDF.OutputType} [outputType="dataurlstring"]
* @param {module:svgcanvas.PDFExportedCallback} cb
* @fires module:svgcanvas.SvgCanvas#event:exportedPDF
@@ -4015,7 +4015,7 @@ this.exportPDF = function (exportWindowName, outputType, cb) {
// opposed to opening a new tab
outputType = outputType || 'dataurlstring';
const obj = {svg, issues, issueCodes, exportWindowName, outputType};
obj.output = doc.output(outputType, outputType === 'save' ? 'Download.pdf' : void 0);
obj.output = doc.output(outputType, outputType === 'save' ? (exportWindowName || 'svg.pdf') : undefined);
if (cb) {
cb(obj);
}