Permalink
Browse files

Added `bloburl` output type.

  • Loading branch information...
1 parent e33e44f commit 140c9799974096efadb41625f5bc5e6fc47edee0 @diegocr diegocr committed Jul 19, 2014
Showing with 7 additions and 4 deletions.
  1. +7 −4 jspdf.js
View
@@ -764,23 +764,26 @@ var jsPDF = (function(global) {
saveAs(getBlob(), options);
if(typeof saveAs.unload === 'function') {
if(global.setTimeout) {
- setTimeout(saveAs.unload,70);
+ setTimeout(saveAs.unload,911);
}
}
break;
case 'arraybuffer':
return getArrayBuffer();
case 'blob':
return getBlob();
+ case 'bloburi':
+ case 'bloburl':
+ // User is responsible of calling revokeObjectURL
+ return global.URL && global.URL.createObjectURL(getBlob()) || void 0;
case 'datauristring':
case 'dataurlstring':
return 'data:application/pdf;base64,' + btoa(buildDocument());
case 'datauri':
case 'dataurl':
- global.document.location.href = 'data:application/pdf;base64,' + btoa(buildDocument());
- break;
+ return global.document.location.href = 'data:application/pdf;base64,' + btoa(buildDocument());
case 'dataurlnewwindow':
- global.open('data:application/pdf;base64,' + btoa(buildDocument()));
+ return global.open('data:application/pdf;base64,' + btoa(buildDocument()));
break;
default:
throw new Error('Output type "' + type + '" is not supported.');

0 comments on commit 140c979

Please sign in to comment.