Permalink
Browse files

BlobBuilder has been deprecated, trying Blob support

  • Loading branch information...
1 parent 31782b1 commit 60db0f31e129cfde0917386bc7e705770d53653b @MrRio committed Jan 15, 2013
Showing with 11 additions and 3 deletions.
  1. +10 −2 jspdf.js
  2. +1 −1 libs/BlobBuilder.js/BlobBuilder.js
View
@@ -1697,7 +1697,7 @@ function jsPDF(/** String */ orientation, /** String */ unit, /** String */ form
return API.output('dataurlnewwindow');
}
- var bb = new BlobBuilder;
+ var bb = new BlobBuilderJS;
var data = buildDocument();
// Need to add the file to BlobBuilder as a Uint8Array
@@ -1708,7 +1708,15 @@ function jsPDF(/** String */ orientation, /** String */ unit, /** String */ form
array[i] = data.charCodeAt(i);
}
- bb.append(array);
+ if (! $.browser.msie) {
+ var blob_data = new Blob([ array ], { type: 'application/pdf'});
+ var url = URL.createObjectURL(blob_data);
+ document.location.href = url;
+ return;
+ } else {
+ bb.append(array);
+
+ }
var blob = bb.getBlob('application/pdf');
saveAs(blob, options);
@@ -13,7 +13,7 @@
/*! @source http://purl.eligrey.com/github/BlobBuilder.js/blob/master/BlobBuilder.js */
-var BlobBuilder = BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder || (function(view) {
+var BlobBuilderJS = Blob || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder || (function(view) {
"use strict";
var
get_class = function(object) {

0 comments on commit 60db0f3

Please sign in to comment.