Skip to content

Commit 140c979

Browse files
committed
Added bloburl output type.
1 parent e33e44f commit 140c979

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

jspdf.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -764,23 +764,26 @@ var jsPDF = (function(global) {
764764
saveAs(getBlob(), options);
765765
if(typeof saveAs.unload === 'function') {
766766
if(global.setTimeout) {
767-
setTimeout(saveAs.unload,70);
767+
setTimeout(saveAs.unload,911);
768768
}
769769
}
770770
break;
771771
case 'arraybuffer':
772772
return getArrayBuffer();
773773
case 'blob':
774774
return getBlob();
775+
case 'bloburi':
776+
case 'bloburl':
777+
// User is responsible of calling revokeObjectURL
778+
return global.URL && global.URL.createObjectURL(getBlob()) || void 0;
775779
case 'datauristring':
776780
case 'dataurlstring':
777781
return 'data:application/pdf;base64,' + btoa(buildDocument());
778782
case 'datauri':
779783
case 'dataurl':
780-
global.document.location.href = 'data:application/pdf;base64,' + btoa(buildDocument());
781-
break;
784+
return global.document.location.href = 'data:application/pdf;base64,' + btoa(buildDocument());
782785
case 'dataurlnewwindow':
783-
global.open('data:application/pdf;base64,' + btoa(buildDocument()));
786+
return global.open('data:application/pdf;base64,' + btoa(buildDocument()));
784787
break;
785788
default:
786789
throw new Error('Output type "' + type + '" is not supported.');

0 commit comments

Comments
 (0)