Skip to content

Commit 9b8f1e9

Browse files
authored
2.3.1
1 parent 20f271a commit 9b8f1e9

File tree

102 files changed

+310
-234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+310
-234
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ yarn add jspdf
2929
Alternatively, load it from a CDN:
3030

3131
```html
32-
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.3.0/jspdf.umd.min.js"></script>
32+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.3.1/jspdf.umd.min.js"></script>
3333
```
3434

3535
Or always get latest version via [unpkg](https://unpkg.com/browse/jspdf/)
@@ -178,7 +178,7 @@ Alternatively, you can load the prebundled polyfill file. This is not recommende
178178
loading polyfills multiple times. Might still be nifty for small applications or quick POCs.
179179

180180
```html
181-
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.3.0/polyfills.umd.js"></script>
181+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.3.1/polyfills.umd.js"></script>
182182
```
183183

184184
## Use of Unicode Characters / UTF-8:

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jspdf",
3-
"version": "2.3.0",
3+
"version": "2.3.1",
44
"homepage": "https://github.com/mrrio/jspdf",
55
"description": "PDF Document creation from JavaScript",
66
"main": [

dist/jspdf.es.js

+21-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @license
22
*
33
* jsPDF - PDF Document creation from JavaScript
4-
* Version 2.3.0 Built on 2021-01-15T15:15:16.557Z
4+
* Version 2.3.1 Built on 2021-03-08T15:44:11.674Z
55
* CommitID 00000000
66
*
77
* Copyright (c) 2010-2020 James Hall <[email protected]>, https://github.com/MrRio/jsPDF
@@ -179,8 +179,8 @@ var saveAs =
179179
? function saveAs() {
180180
/* noop */
181181
}
182-
: // Use download attribute first if possible (#193 Lumia mobile)
183-
"download" in HTMLAnchorElement.prototype
182+
: // Use download attribute first if possible (#193 Lumia mobile) unless this is a native app
183+
(typeof HTMLAnchorElement !== "undefined" && "download" in HTMLAnchorElement.prototype)
184184
? function saveAs(blob, name, opts) {
185185
var URL = globalObject.URL || globalObject.webkitURL;
186186
var a = document.createElement("a");
@@ -3971,12 +3971,22 @@ function jsPDF(options) {
39713971
*
39723972
* If `type` argument is undefined, output is raw body of resulting PDF returned as a string.
39733973
*
3974-
* @param {string} type A string identifying one of the possible output types. Possible values are 'arraybuffer', 'blob', 'bloburi'/'bloburl', 'datauristring'/'dataurlstring', 'datauri'/'dataurl', 'dataurlnewwindow', 'pdfobjectnewwindow', 'pdfjsnewwindow'.
3975-
* @param {Object} options An object providing some additional signalling to PDF generator. Possible options are 'filename'.
3976-
*
3974+
* @param {string} type A string identifying one of the possible output types.<br/>
3975+
* Possible values are: <br/>
3976+
* 'arraybuffer' -> (ArrayBuffer)<br/>
3977+
* 'blob' -> (Blob)<br/>
3978+
* 'bloburi'/'bloburl' -> (string)<br/>
3979+
* 'datauristring'/'dataurlstring' -> (string)<br/>
3980+
* 'datauri'/'dataurl' -> (undefined) -> change location to generated datauristring/dataurlstring<br/>
3981+
* 'dataurlnewwindow' -> (window | null | undefined) throws error if global isn't a window object(node)<br/>
3982+
* 'pdfobjectnewwindow' -> (window | null) throws error if global isn't a window object(node)<br/>
3983+
* 'pdfjsnewwindow' -> (wind | null)
3984+
* @param {Object|string} options An object providing some additional signalling to PDF generator.<br/>
3985+
* Possible options are 'filename'.<br/>
3986+
* A string can be passed instead of {filename:string} and defaults to 'generated.pdf'
39773987
* @function
39783988
* @instance
3979-
* @returns {jsPDF}
3989+
* @returns {string|window|ArrayBuffer|Blob|jsPDF|null|undefined}
39803990
* @memberof jsPDF#
39813991
* @name output
39823992
*/
@@ -6957,7 +6967,7 @@ jsPDF.API = {
69576967
* @type {string}
69586968
* @memberof jsPDF#
69596969
*/
6960-
jsPDF.version = "2.3.0";
6970+
jsPDF.version = "2.3.1";
69616971

69626972
/* global jsPDF */
69636973

@@ -10696,7 +10706,7 @@ var AcroForm = jsPDF.AcroForm;
1069610706
var result = null;
1069710707

1069810708
if (dataUrlParts.length === 2) {
10699-
var extractedInfo = /^data:(\w*\/\w*);*(charset=[\w=-]*)*;*$/.exec(
10709+
var extractedInfo = /^data:(\w*\/\w*);*(charset=(?!charset=)[\w=-]*)*;*$/.exec(
1070010710
dataUrlParts[0]
1070110711
);
1070210712
if (Array.isArray(extractedInfo)) {
@@ -12163,6 +12173,7 @@ var AcroForm = jsPDF.AcroForm;
1216312173
var amountOfLines = 0;
1216412174
var height = 0;
1216512175
var tempWidth = 0;
12176+
var scope = this;
1216612177

1216712178
if (!Array.isArray(text) && typeof text !== "string") {
1216812179
if (typeof text === "number") {
@@ -12418,7 +12429,7 @@ var AcroForm = jsPDF.AcroForm;
1241812429
});
1241912430
}
1242012431

12421-
if (autoSize) {
12432+
if (autoSize || (Array.isArray(headers) && typeof headers[0] === "string")) {
1242212433
var headerName;
1242312434
for (i = 0; i < headerNames.length; i += 1) {
1242412435
headerName = headerNames[i];

dist/jspdf.es.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jspdf.es.min.js

+9-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jspdf.es.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jspdf.node.js

+19-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @license
22
*
33
* jsPDF - PDF Document creation from JavaScript
4-
* Version 2.3.0 Built on 2021-01-15T15:15:16.557Z
4+
* Version 2.3.1 Built on 2021-03-08T15:44:11.674Z
55
* CommitID 00000000
66
*
77
* Copyright (c) 2010-2020 James Hall <[email protected]>, https://github.com/MrRio/jsPDF
@@ -3787,12 +3787,22 @@ function jsPDF(options) {
37873787
*
37883788
* If `type` argument is undefined, output is raw body of resulting PDF returned as a string.
37893789
*
3790-
* @param {string} type A string identifying one of the possible output types. Possible values are 'arraybuffer', 'blob', 'bloburi'/'bloburl', 'datauristring'/'dataurlstring', 'datauri'/'dataurl', 'dataurlnewwindow', 'pdfobjectnewwindow', 'pdfjsnewwindow'.
3791-
* @param {Object} options An object providing some additional signalling to PDF generator. Possible options are 'filename'.
3792-
*
3790+
* @param {string} type A string identifying one of the possible output types.<br/>
3791+
* Possible values are: <br/>
3792+
* 'arraybuffer' -> (ArrayBuffer)<br/>
3793+
* 'blob' -> (Blob)<br/>
3794+
* 'bloburi'/'bloburl' -> (string)<br/>
3795+
* 'datauristring'/'dataurlstring' -> (string)<br/>
3796+
* 'datauri'/'dataurl' -> (undefined) -> change location to generated datauristring/dataurlstring<br/>
3797+
* 'dataurlnewwindow' -> (window | null | undefined) throws error if global isn't a window object(node)<br/>
3798+
* 'pdfobjectnewwindow' -> (window | null) throws error if global isn't a window object(node)<br/>
3799+
* 'pdfjsnewwindow' -> (wind | null)
3800+
* @param {Object|string} options An object providing some additional signalling to PDF generator.<br/>
3801+
* Possible options are 'filename'.<br/>
3802+
* A string can be passed instead of {filename:string} and defaults to 'generated.pdf'
37933803
* @function
37943804
* @instance
3795-
* @returns {jsPDF}
3805+
* @returns {string|window|ArrayBuffer|Blob|jsPDF|null|undefined}
37963806
* @memberof jsPDF#
37973807
* @name output
37983808
*/
@@ -6766,7 +6776,7 @@ jsPDF.API = {
67666776
* @type {string}
67676777
* @memberof jsPDF#
67686778
*/
6769-
jsPDF.version = "2.3.0";
6779+
jsPDF.version = "2.3.1";
67706780

67716781
/* global jsPDF */
67726782

@@ -10505,7 +10515,7 @@ var AcroForm = jsPDF.AcroForm;
1050510515
var result = null;
1050610516

1050710517
if (dataUrlParts.length === 2) {
10508-
var extractedInfo = /^data:(\w*\/\w*);*(charset=[\w=-]*)*;*$/.exec(
10518+
var extractedInfo = /^data:(\w*\/\w*);*(charset=(?!charset=)[\w=-]*)*;*$/.exec(
1050910519
dataUrlParts[0]
1051010520
);
1051110521
if (Array.isArray(extractedInfo)) {
@@ -11972,6 +11982,7 @@ var AcroForm = jsPDF.AcroForm;
1197211982
var amountOfLines = 0;
1197311983
var height = 0;
1197411984
var tempWidth = 0;
11985+
var scope = this;
1197511986

1197611987
if (!Array.isArray(text) && typeof text !== "string") {
1197711988
if (typeof text === "number") {
@@ -12227,7 +12238,7 @@ var AcroForm = jsPDF.AcroForm;
1222712238
});
1222812239
}
1222912240

12230-
if (autoSize) {
12241+
if (autoSize || (Array.isArray(headers) && typeof headers[0] === "string")) {
1223112242
var headerName;
1223212243
for (i = 0; i < headerNames.length; i += 1) {
1223312244
headerName = headerNames[i];

dist/jspdf.node.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jspdf.node.min.js

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jspdf.node.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jspdf.umd.js

+21-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @license
22
*
33
* jsPDF - PDF Document creation from JavaScript
4-
* Version 2.3.0 Built on 2021-01-15T15:15:16.555Z
4+
* Version 2.3.1 Built on 2021-03-08T15:44:11.672Z
55
* CommitID 00000000
66
*
77
* Copyright (c) 2010-2020 James Hall <[email protected]>, https://github.com/MrRio/jsPDF
@@ -183,8 +183,8 @@
183183
? function saveAs() {
184184
/* noop */
185185
}
186-
: // Use download attribute first if possible (#193 Lumia mobile)
187-
"download" in HTMLAnchorElement.prototype
186+
: // Use download attribute first if possible (#193 Lumia mobile) unless this is a native app
187+
(typeof HTMLAnchorElement !== "undefined" && "download" in HTMLAnchorElement.prototype)
188188
? function saveAs(blob, name, opts) {
189189
var URL = globalObject.URL || globalObject.webkitURL;
190190
var a = document.createElement("a");
@@ -3975,12 +3975,22 @@
39753975
*
39763976
* If `type` argument is undefined, output is raw body of resulting PDF returned as a string.
39773977
*
3978-
* @param {string} type A string identifying one of the possible output types. Possible values are 'arraybuffer', 'blob', 'bloburi'/'bloburl', 'datauristring'/'dataurlstring', 'datauri'/'dataurl', 'dataurlnewwindow', 'pdfobjectnewwindow', 'pdfjsnewwindow'.
3979-
* @param {Object} options An object providing some additional signalling to PDF generator. Possible options are 'filename'.
3980-
*
3978+
* @param {string} type A string identifying one of the possible output types.<br/>
3979+
* Possible values are: <br/>
3980+
* 'arraybuffer' -> (ArrayBuffer)<br/>
3981+
* 'blob' -> (Blob)<br/>
3982+
* 'bloburi'/'bloburl' -> (string)<br/>
3983+
* 'datauristring'/'dataurlstring' -> (string)<br/>
3984+
* 'datauri'/'dataurl' -> (undefined) -> change location to generated datauristring/dataurlstring<br/>
3985+
* 'dataurlnewwindow' -> (window | null | undefined) throws error if global isn't a window object(node)<br/>
3986+
* 'pdfobjectnewwindow' -> (window | null) throws error if global isn't a window object(node)<br/>
3987+
* 'pdfjsnewwindow' -> (wind | null)
3988+
* @param {Object|string} options An object providing some additional signalling to PDF generator.<br/>
3989+
* Possible options are 'filename'.<br/>
3990+
* A string can be passed instead of {filename:string} and defaults to 'generated.pdf'
39813991
* @function
39823992
* @instance
3983-
* @returns {jsPDF}
3993+
* @returns {string|window|ArrayBuffer|Blob|jsPDF|null|undefined}
39843994
* @memberof jsPDF#
39853995
* @name output
39863996
*/
@@ -6961,7 +6971,7 @@
69616971
* @type {string}
69626972
* @memberof jsPDF#
69636973
*/
6964-
jsPDF.version = "2.3.0";
6974+
jsPDF.version = "2.3.1";
69656975

69666976
/* global jsPDF */
69676977

@@ -10700,7 +10710,7 @@
1070010710
var result = null;
1070110711

1070210712
if (dataUrlParts.length === 2) {
10703-
var extractedInfo = /^data:(\w*\/\w*);*(charset=[\w=-]*)*;*$/.exec(
10713+
var extractedInfo = /^data:(\w*\/\w*);*(charset=(?!charset=)[\w=-]*)*;*$/.exec(
1070410714
dataUrlParts[0]
1070510715
);
1070610716
if (Array.isArray(extractedInfo)) {
@@ -12167,6 +12177,7 @@
1216712177
var amountOfLines = 0;
1216812178
var height = 0;
1216912179
var tempWidth = 0;
12180+
var scope = this;
1217012181

1217112182
if (!Array.isArray(text) && typeof text !== "string") {
1217212183
if (typeof text === "number") {
@@ -12422,7 +12433,7 @@
1242212433
});
1242312434
}
1242412435

12425-
if (autoSize) {
12436+
if (autoSize || (Array.isArray(headers) && typeof headers[0] === "string")) {
1242612437
var headerName;
1242712438
for (i = 0; i < headerNames.length; i += 1) {
1242812439
headerName = headerNames[i];

dist/jspdf.umd.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)