Skip to content

Commit

Permalink
Added bloburl output type.
Browse files Browse the repository at this point in the history
  • Loading branch information
diegocr committed Jul 19, 2014
1 parent e33e44f commit 140c979
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions jspdf.js
Expand Up @@ -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.');
Expand Down

0 comments on commit 140c979

Please sign in to comment.