@@ -129,8 +129,8 @@ var asyncGenerator = function () {
129
129
130
130
/** @preserve
131
131
* jsPDF - PDF Document creation from JavaScript
132
- * Version 1.3.4 Built on 2017-09-11T11:23:37.340Z
133
- * CommitID a9c6ecb794
132
+ * Version 1.3.4 Built on 2017-09-11T18:13:05.073Z
133
+ * CommitID daacf2c6e2
134
134
*
135
135
* Copyright (c) 2010-2016 James Hall <
[email protected] >, https://github.com/MrRio/jsPDF
136
136
* 2010 Aaron Spike, https://github.com/acspike
@@ -3009,7 +3009,8 @@ AcroForm.Appearance.internal = {
3009
3009
var cross = {
3010
3010
x1: { // upperLeft
3011
3011
x: (width - a) / 2,
3012
- y: (height - a) / 2 + a },
3012
+ y: (height - a) / 2 + a //height - borderPadding
3013
+ },
3013
3014
x2: { // lowerRight
3014
3015
x: (width - a) / 2 + a,
3015
3016
y: (height - a) / 2 //borderPadding
@@ -3020,7 +3021,8 @@ AcroForm.Appearance.internal = {
3020
3021
},
3021
3022
x4: { // upperRight
3022
3023
x: (width - a) / 2 + a,
3023
- y: (height - a) / 2 + a }
3024
+ y: (height - a) / 2 + a //height - borderPadding
3025
+ }
3024
3026
};
3025
3027
3026
3028
return cross;
@@ -9343,24 +9345,24 @@ MIT license.
9343
9345
'Times-Italic': encodingBlock
9344
9346
// , 'Symbol'
9345
9347
// , 'ZapfDingbats'
9346
- } }
9347
- /**
9348
- Resources:
9349
- Font metrics data is reprocessed derivative of contents of
9350
- "Font Metrics for PDF Core 14 Fonts" package, which exhibits the following copyright and license:
9351
-
9352
- Copyright (c) 1989, 1990, 1991, 1992, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.
9353
-
9354
- This file and the 14 PostScript(R) AFM files it accompanies may be used,
9355
- copied, and distributed for any purpose and without charge, with or without
9356
- modification, provided that all copyright notices are retained; that the AFM
9357
- files are not distributed without this file; that all modifications to this
9358
- file or any of the AFM files are prominently noted in the modified file(s);
9359
- and that this paragraph is not modified. Adobe Systems has no responsibility
9360
- or obligation to support the use of the AFM files.
9361
-
9362
- */
9363
- ,
9348
+ }
9349
+ /**
9350
+ Resources:
9351
+ Font metrics data is reprocessed derivative of contents of
9352
+ "Font Metrics for PDF Core 14 Fonts" package, which exhibits the following copyright and license:
9353
+
9354
+ Copyright (c) 1989, 1990, 1991, 1992, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.
9355
+
9356
+ This file and the 14 PostScript(R) AFM files it accompanies may be used,
9357
+ copied, and distributed for any purpose and without charge, with or without
9358
+ modification, provided that all copyright notices are retained; that the AFM
9359
+ files are not distributed without this file; that all modifications to this
9360
+ file or any of the AFM files are prominently noted in the modified file(s);
9361
+ and that this paragraph is not modified. Adobe Systems has no responsibility
9362
+ or obligation to support the use of the AFM files.
9363
+
9364
+ */
9365
+ } ,
9364
9366
fontMetrics = { 'Unicode': {
9365
9367
// all sizing numbers are n/fontMetricsFractionOf = one font size unit
9366
9368
// this means that if fontMetricsFractionOf = 1000, and letter A's width is 476, it's
@@ -9882,7 +9884,8 @@ Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
9882
9884
9883
9885
/* FileSaver.js
9884
9886
* A saveAs() FileSaver implementation.
9885
- * 1.1.20151003
9887
+ * 1.3.2
9888
+ * 2016-06-16 18:25:19
9886
9889
*
9887
9890
* By Eli Grey, http://eligrey.com
9888
9891
* License: MIT
@@ -9897,7 +9900,7 @@ Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
9897
9900
var saveAs = saveAs || (function(view) {
9898
9901
"use strict";
9899
9902
// IE <10 is explicitly unsupported
9900
- if (typeof navigator !== "undefined" && /MSIE [1-9]\./.test(navigator.userAgent)) {
9903
+ if (typeof view === "undefined" || typeof navigator !== "undefined" && /MSIE [1-9]\./.test(navigator.userAgent)) {
9901
9904
return;
9902
9905
}
9903
9906
var
@@ -9912,20 +9915,16 @@ var saveAs = saveAs || (function(view) {
9912
9915
var event = new MouseEvent("click");
9913
9916
node.dispatchEvent(event);
9914
9917
}
9915
- , is_safari = /Version\/[\d\.]+.*Safari/.test(navigator.userAgent)
9916
- , webkit_req_fs = view.webkitRequestFileSystem
9917
- , req_fs = view.requestFileSystem || webkit_req_fs || view.mozRequestFileSystem
9918
+ , is_safari = /constructor/i.test(view.HTMLElement) || view.safari
9919
+ , is_chrome_ios =/CriOS\/[\d]+/.test(navigator.userAgent)
9918
9920
, throw_outside = function(ex) {
9919
9921
(view.setImmediate || view.setTimeout)(function() {
9920
9922
throw ex;
9921
9923
}, 0);
9922
9924
}
9923
9925
, force_saveable_type = "application/octet-stream"
9924
- , fs_min_size = 0
9925
- // See https://code.google.com/p/chromium/issues/detail?id=375297#c7 and
9926
- // https://github.com/eligrey/FileSaver.js/commit/485930a#commitcomment-8768047
9927
- // for the reasoning behind the timeout and revocation flow
9928
- , arbitrary_revoke_timeout = 500 // in ms
9926
+ // the Blob API is fundamentally broken as there is no "downloadfinished" event to subscribe to
9927
+ , arbitrary_revoke_timeout = 1000 * 40 // in ms
9929
9928
, revoke = function(file) {
9930
9929
var revoker = function() {
9931
9930
if (typeof file === "string") { // file is an object URL
@@ -9934,11 +9933,7 @@ var saveAs = saveAs || (function(view) {
9934
9933
file.remove();
9935
9934
}
9936
9935
};
9937
- if (view.chrome) {
9938
- revoker();
9939
- } else {
9940
- setTimeout(revoker, arbitrary_revoke_timeout);
9941
- }
9936
+ setTimeout(revoker, arbitrary_revoke_timeout);
9942
9937
}
9943
9938
, dispatch = function(filesaver, event_types, event) {
9944
9939
event_types = [].concat(event_types);
@@ -9956,8 +9951,9 @@ var saveAs = saveAs || (function(view) {
9956
9951
}
9957
9952
, auto_bom = function(blob) {
9958
9953
// prepend BOM for UTF-8 XML and text/* types (including HTML)
9954
+ // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF
9959
9955
if (/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) {
9960
- return new Blob(["\ufeff" , blob], {type: blob.type});
9956
+ return new Blob([String.fromCharCode(0xFEFF) , blob], {type: blob.type});
9961
9957
}
9962
9958
return blob;
9963
9959
}
@@ -9969,20 +9965,21 @@ var saveAs = saveAs || (function(view) {
9969
9965
var
9970
9966
filesaver = this
9971
9967
, type = blob.type
9972
- , blob_changed = false
9968
+ , force = type === force_saveable_type
9973
9969
, object_url
9974
- , target_view
9975
9970
, dispatch_all = function() {
9976
9971
dispatch(filesaver, "writestart progress write writeend".split(" "));
9977
9972
}
9978
9973
// on any filesys errors revert to saving with object URLs
9979
9974
, fs_error = function() {
9980
- if (target_view && is_safari && typeof FileReader !== "undefined" ) {
9975
+ if ((is_chrome_ios || (force && is_safari)) && view. FileReader) {
9981
9976
// Safari doesn't allow downloading of blob urls
9982
9977
var reader = new FileReader();
9983
9978
reader.onloadend = function() {
9984
- var base64Data = reader.result;
9985
- target_view.location.href = "data:attachment/file" + base64Data.slice(base64Data.search(/[,;]/));
9979
+ var url = is_chrome_ios ? reader.result : reader.result.replace(/^data:[^;]*;/, 'data:attachment/file;');
9980
+ var popup = view.open(url, '_blank');
9981
+ if(!popup) view.location.href = url;
9982
+ url=undefined; // release reference before dispatching
9986
9983
filesaver.readyState = filesaver.DONE;
9987
9984
dispatch_all();
9988
9985
};
@@ -9991,35 +9988,24 @@ var saveAs = saveAs || (function(view) {
9991
9988
return;
9992
9989
}
9993
9990
// don't create more object URLs than needed
9994
- if (blob_changed || !object_url) {
9991
+ if (!object_url) {
9995
9992
object_url = get_URL().createObjectURL(blob);
9996
9993
}
9997
- if (target_view ) {
9998
- target_view .location.href = object_url;
9994
+ if (force ) {
9995
+ view .location.href = object_url;
9999
9996
} else {
10000
- var new_tab = view.open(object_url, "_blank");
10001
- if (new_tab == undefined && is_safari ) {
10002
- //Apple do not allow window.open, see http ://bit.ly/1kZffRI
9997
+ var opened = view.open(object_url, "_blank");
9998
+ if (!opened ) {
9999
+ // Apple does not allow window.open, see https ://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/WorkingwithWindowsandTabs/WorkingwithWindowsandTabs.html
10003
10000
view.location.href = object_url;
10004
10001
}
10005
10002
}
10006
10003
filesaver.readyState = filesaver.DONE;
10007
10004
dispatch_all();
10008
10005
revoke(object_url);
10009
- }
10010
- , abortable = function(func) {
10011
- return function() {
10012
- if (filesaver.readyState !== filesaver.DONE) {
10013
- return func.apply(this, arguments);
10014
- }
10015
- };
10016
- }
10017
- , create_if_not_found = {create: true, exclusive: false}
10018
- , slice;
10006
+ };
10019
10007
filesaver.readyState = filesaver.INIT;
10020
- if (!name) {
10021
- name = "download";
10022
- }
10008
+
10023
10009
if (can_use_save_link) {
10024
10010
object_url = get_URL().createObjectURL(blob);
10025
10011
setTimeout(function() {
@@ -10032,92 +10018,26 @@ var saveAs = saveAs || (function(view) {
10032
10018
});
10033
10019
return;
10034
10020
}
10035
- // Object and web filesystem URLs have a problem saving in Google Chrome when
10036
- // viewed in a tab, so I force save with application/octet-stream
10037
- // http://code.google.com/p/chromium/issues/detail?id=91158
10038
- // Update: Google errantly closed 91158, I submitted it again:
10039
- // https://code.google.com/p/chromium/issues/detail?id=389642
10040
- if (view.chrome && type && type !== force_saveable_type) {
10041
- slice = blob.slice || blob.webkitSlice;
10042
- blob = slice.call(blob, 0, blob.size, force_saveable_type);
10043
- blob_changed = true;
10044
- }
10045
- // Since I can't be sure that the guessed media type will trigger a download
10046
- // in WebKit, I append .download to the filename.
10047
- // https://bugs.webkit.org/show_bug.cgi?id=65440
10048
- if (webkit_req_fs && name !== "download") {
10049
- name += ".download";
10050
- }
10051
- if (type === force_saveable_type || webkit_req_fs) {
10052
- target_view = view;
10053
- }
10054
- if (!req_fs) {
10055
- fs_error();
10056
- return;
10057
- }
10058
- fs_min_size += blob.size;
10059
- req_fs(view.TEMPORARY, fs_min_size, abortable(function(fs) {
10060
- fs.root.getDirectory("saved", create_if_not_found, abortable(function(dir) {
10061
- var save = function() {
10062
- dir.getFile(name, create_if_not_found, abortable(function(file) {
10063
- file.createWriter(abortable(function(writer) {
10064
- writer.onwriteend = function(event) {
10065
- target_view.location.href = file.toURL();
10066
- filesaver.readyState = filesaver.DONE;
10067
- dispatch(filesaver, "writeend", event);
10068
- revoke(file);
10069
- };
10070
- writer.onerror = function() {
10071
- var error = writer.error;
10072
- if (error.code !== error.ABORT_ERR) {
10073
- fs_error();
10074
- }
10075
- };
10076
- "writestart progress write abort".split(" ").forEach(function(event) {
10077
- writer["on" + event] = filesaver["on" + event];
10078
- });
10079
- writer.write(blob);
10080
- filesaver.abort = function() {
10081
- writer.abort();
10082
- filesaver.readyState = filesaver.DONE;
10083
- };
10084
- filesaver.readyState = filesaver.WRITING;
10085
- }), fs_error);
10086
- }), fs_error);
10087
- };
10088
- dir.getFile(name, {create: false}, abortable(function(file) {
10089
- // delete file if it already exists
10090
- file.remove();
10091
- save();
10092
- }), abortable(function(ex) {
10093
- if (ex.code === ex.NOT_FOUND_ERR) {
10094
- save();
10095
- } else {
10096
- fs_error();
10097
- }
10098
- }));
10099
- }), fs_error);
10100
- }), fs_error);
10021
+
10022
+ fs_error();
10101
10023
}
10102
10024
, FS_proto = FileSaver.prototype
10103
10025
, saveAs = function(blob, name, no_auto_bom) {
10104
- return new FileSaver(blob, name, no_auto_bom);
10026
+ return new FileSaver(blob, name || blob.name || "download" , no_auto_bom);
10105
10027
};
10106
10028
// IE 10+ (native saveAs)
10107
10029
if (typeof navigator !== "undefined" && navigator.msSaveOrOpenBlob) {
10108
10030
return function(blob, name, no_auto_bom) {
10031
+ name = name || blob.name || "download";
10032
+
10109
10033
if (!no_auto_bom) {
10110
10034
blob = auto_bom(blob);
10111
10035
}
10112
- return navigator.msSaveOrOpenBlob(blob, name || "download" );
10036
+ return navigator.msSaveOrOpenBlob(blob, name);
10113
10037
};
10114
10038
}
10115
10039
10116
- FS_proto.abort = function() {
10117
- var filesaver = this;
10118
- filesaver.readyState = filesaver.DONE;
10119
- dispatch(filesaver, "abort");
10120
- };
10040
+ FS_proto.abort = function(){};
10121
10041
FS_proto.readyState = FS_proto.INIT = 0;
10122
10042
FS_proto.WRITING = 1;
10123
10043
FS_proto.DONE = 2;
@@ -10143,8 +10063,8 @@ var saveAs = saveAs || (function(view) {
10143
10063
10144
10064
if (typeof module !== "undefined" && module.exports) {
10145
10065
module.exports.saveAs = saveAs;
10146
- } else if ((typeof define !== "undefined" && define !== null) && (define.amd != null)) {
10147
- define([] , function() {
10066
+ } else if ((typeof define !== "undefined" && define !== null) && (define.amd !== null)) {
10067
+ define("FileSaver.js" , function() {
10148
10068
return saveAs;
10149
10069
});
10150
10070
}
0 commit comments