Skip to content

Commit 7315ccb

Browse files
authored
2.5.1
1 parent a56c882 commit 7315ccb

File tree

105 files changed

+231
-199
lines changed

Some content is hidden

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

105 files changed

+231
-199
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.5.0/jspdf.umd.min.js"></script>
32+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.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.5.0/polyfills.umd.js"></script>
181+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.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.5.0",
3+
"version": "2.5.1",
44
"homepage": "https://github.com/mrrio/jspdf",
55
"description": "PDF Document creation from JavaScript",
66
"main": [

dist/jspdf.es.js

+12-5
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.5.0 Built on 2021-12-21T09:44:51.866Z
4+
* Version 2.5.1 Built on 2022-01-28T15:37:57.791Z
55
* CommitID 00000000
66
*
77
* Copyright (c) 2010-2021 James Hall <[email protected]>, https://github.com/MrRio/jsPDF
@@ -1794,7 +1794,7 @@ function jsPDF(options) {
17941794
var setZoomMode = API.__private__.setZoomMode = function (zoom) {
17951795
var validZoomModes = [undefined, null, "fullwidth", "fullheight", "fullpage", "original"];
17961796

1797-
if (/^\d*\.?\d*%$/.test(zoom)) {
1797+
if (/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(zoom)) {
17981798
zoomMode = zoom;
17991799
} else if (!isNaN(zoom)) {
18001800
zoomMode = parseInt(zoom, 10);
@@ -3876,8 +3876,15 @@ function jsPDF(options) {
38763876

38773877
case "pdfobjectnewwindow":
38783878
if (Object.prototype.toString.call(globalObject) === "[object Window]") {
3879-
var pdfObjectUrl = options.pdfObjectUrl || "https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js";
3880-
var htmlForNewWindow = "<html>" + '<style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="' + pdfObjectUrl + '"></script><script >PDFObject.embed("' + this.output("dataurlstring") + '", ' + JSON.stringify(options) + ");</script></body></html>";
3879+
var pdfObjectUrl = "https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js";
3880+
var integrity = ' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';
3881+
3882+
if (options.pdfObjectUrl) {
3883+
pdfObjectUrl = options.pdfObjectUrl;
3884+
integrity = "";
3885+
}
3886+
3887+
var htmlForNewWindow = "<html>" + '<style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="' + pdfObjectUrl + '"' + integrity + '></script><script >PDFObject.embed("' + this.output("dataurlstring") + '", ' + JSON.stringify(options) + ");</script></body></html>";
38813888
var nW = globalObject.open();
38823889

38833890
if (nW !== null) {
@@ -6642,7 +6649,7 @@ jsPDF.API = {
66426649
* @memberof jsPDF#
66436650
*/
66446651

6645-
jsPDF.version = "2.5.0";
6652+
jsPDF.version = "2.5.1";
66466653

66476654
var jsPDFAPI = jsPDF.API;
66486655
var scaleFactor = 1;

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

+7-7
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

+14-5
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.5.0 Built on 2021-12-21T09:44:51.866Z
4+
* Version 2.5.1 Built on 2022-01-28T15:37:57.791Z
55
* CommitID 00000000
66
*
77
* Copyright (c) 2010-2021 James Hall <[email protected]>, https://github.com/MrRio/jsPDF
@@ -1714,7 +1714,7 @@ function jsPDF(options) {
17141714
"original"
17151715
];
17161716

1717-
if (/^\d*\.?\d*%$/.test(zoom)) {
1717+
if (/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(zoom)) {
17181718
zoomMode = zoom;
17191719
} else if (!isNaN(zoom)) {
17201720
zoomMode = parseInt(zoom, 10);
@@ -3913,13 +3913,22 @@ function jsPDF(options) {
39133913
Object.prototype.toString.call(globalObject) === "[object Window]"
39143914
) {
39153915
var pdfObjectUrl =
3916-
options.pdfObjectUrl ||
39173916
"https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js";
3917+
var integrity =
3918+
' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';
3919+
3920+
if (options.pdfObjectUrl) {
3921+
pdfObjectUrl = options.pdfObjectUrl;
3922+
integrity = "";
3923+
}
3924+
39183925
var htmlForNewWindow =
39193926
"<html>" +
39203927
'<style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="' +
39213928
pdfObjectUrl +
3922-
'"></script><script >PDFObject.embed("' +
3929+
'"' +
3930+
integrity +
3931+
'></script><script >PDFObject.embed("' +
39233932
this.output("dataurlstring") +
39243933
'", ' +
39253934
JSON.stringify(options) +
@@ -6852,7 +6861,7 @@ jsPDF.API = {
68526861
* @type {string}
68536862
* @memberof jsPDF#
68546863
*/
6855-
jsPDF.version = "2.5.0";
6864+
jsPDF.version = "2.5.1";
68566865

68576866
/* global jsPDF */
68586867

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

+2-2
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

+12-5
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.5.0 Built on 2021-12-21T09:44:51.864Z
4+
* Version 2.5.1 Built on 2022-01-28T15:37:57.789Z
55
* CommitID 00000000
66
*
77
* Copyright (c) 2010-2021 James Hall <[email protected]>, https://github.com/MrRio/jsPDF
@@ -1813,7 +1813,7 @@
18131813
var setZoomMode = API.__private__.setZoomMode = function (zoom) {
18141814
var validZoomModes = [undefined, null, "fullwidth", "fullheight", "fullpage", "original"];
18151815

1816-
if (/^\d*\.?\d*%$/.test(zoom)) {
1816+
if (/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(zoom)) {
18171817
zoomMode = zoom;
18181818
} else if (!isNaN(zoom)) {
18191819
zoomMode = parseInt(zoom, 10);
@@ -3895,8 +3895,15 @@
38953895

38963896
case "pdfobjectnewwindow":
38973897
if (Object.prototype.toString.call(globalObject) === "[object Window]") {
3898-
var pdfObjectUrl = options.pdfObjectUrl || "https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js";
3899-
var htmlForNewWindow = "<html>" + '<style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="' + pdfObjectUrl + '"></script><script >PDFObject.embed("' + this.output("dataurlstring") + '", ' + JSON.stringify(options) + ");</script></body></html>";
3898+
var pdfObjectUrl = "https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js";
3899+
var integrity = ' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';
3900+
3901+
if (options.pdfObjectUrl) {
3902+
pdfObjectUrl = options.pdfObjectUrl;
3903+
integrity = "";
3904+
}
3905+
3906+
var htmlForNewWindow = "<html>" + '<style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="' + pdfObjectUrl + '"' + integrity + '></script><script >PDFObject.embed("' + this.output("dataurlstring") + '", ' + JSON.stringify(options) + ");</script></body></html>";
39003907
var nW = globalObject.open();
39013908

39023909
if (nW !== null) {
@@ -6661,7 +6668,7 @@
66616668
* @memberof jsPDF#
66626669
*/
66636670

6664-
jsPDF.version = "2.5.0";
6671+
jsPDF.version = "2.5.1";
66656672

66666673
var jsPDFAPI = jsPDF.API;
66676674
var scaleFactor = 1;

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.

dist/jspdf.umd.min.js

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

dist/jspdf.umd.min.js.map

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

dist/polyfills.es.js

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

dist/polyfills.umd.js

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

docs/GState.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ <h4 class="name" id="GState"><span class="type-signature"></span>new GState<span
7171

7272
<dt class="tag-source">Source:</dt>
7373
<dd class="tag-source"><ul class="dummy"><li>
74-
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line5431">line 5431</a>
74+
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line5440">line 5440</a>
7575
</li></ul></dd>
7676

7777

@@ -458,7 +458,7 @@ <h5>Type:</h5>
458458
<br class="clear">
459459

460460
<footer>
461-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Tue Dec 21 2021 10:45:12 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
461+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Fri Jan 28 2022 16:38:20 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
462462
</footer>
463463

464464
<script>prettyPrint();</script>

docs/Matrix.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1753,7 +1753,7 @@ <h4 class="name" id="toString"><span class="type-signature"></span>toString<span
17531753
<br class="clear">
17541754

17551755
<footer>
1756-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Tue Dec 21 2021 10:45:12 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1756+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Fri Jan 28 2022 16:38:20 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
17571757
</footer>
17581758

17591759
<script>prettyPrint();</script>

docs/global.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -2117,7 +2117,7 @@ <h4 class="name" id="PatternData">PatternData</h4>
21172117

21182118
<dt class="tag-source">Source:</dt>
21192119
<dd class="tag-source"><ul class="dummy"><li>
2120-
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line4452">line 4452</a>
2120+
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line4461">line 4461</a>
21212121
</li></ul></dd>
21222122

21232123

@@ -2198,7 +2198,7 @@ <h5>Type:</h5>
21982198
<br class="clear">
21992199

22002200
<footer>
2201-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Tue Dec 21 2021 10:45:12 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
2201+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Fri Jan 28 2022 16:38:20 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
22022202
</footer>
22032203

22042204
<script>prettyPrint();</script>

docs/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ <h2>Install</h2>
7676
yarn add jspdf
7777
</code></pre>
7878
<p>Alternatively, load it from a CDN:</p>
79-
<pre class="prettyprint source lang-html"><code>&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.0/jspdf.umd.min.js&quot;>&lt;/script>
79+
<pre class="prettyprint source lang-html"><code>&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js&quot;>&lt;/script>
8080
</code></pre>
8181
<p>Or always get latest version via <a href="https://unpkg.com/browse/jspdf/">unpkg</a></p>
8282
<pre class="prettyprint source lang-html"><code>&lt;script src=&quot;https://unpkg.com/jspdf@latest/dist/jspdf.umd.min.js&quot;>&lt;/script>
@@ -181,7 +181,7 @@ <h3>Polyfills</h3>
181181
</code></pre>
182182
<p>Alternatively, you can load the prebundled polyfill file. This is not recommended, since you might end up
183183
loading polyfills multiple times. Might still be nifty for small applications or quick POCs.</p>
184-
<pre class="prettyprint source lang-html"><code>&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.0/polyfills.umd.js&quot;>&lt;/script>
184+
<pre class="prettyprint source lang-html"><code>&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/polyfills.umd.js&quot;>&lt;/script>
185185
</code></pre>
186186
<h2>Use of Unicode Characters / UTF-8:</h2>
187187
<p>The 14 standard fonts in PDF are limited to the ASCII-codepage. If you want to use UTF-8 you have to integrate a
@@ -280,7 +280,7 @@ <h2>License (MIT)</h2>
280280
<br class="clear">
281281

282282
<footer>
283-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Tue Dec 21 2021 10:45:12 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
283+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Fri Jan 28 2022 16:38:20 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
284284
</footer>
285285

286286
<script>prettyPrint();</script>

docs/jsPDF-API.GState.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ <h4 class="name" id="GState"><span class="type-signature"></span>new GState<span
7171

7272
<dt class="tag-source">Source:</dt>
7373
<dd class="tag-source"><ul class="dummy"><li>
74-
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line5442">line 5442</a>
74+
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line5451">line 5451</a>
7575
</li></ul></dd>
7676

7777

@@ -219,7 +219,7 @@ <h5>Parameters:</h5>
219219
<br class="clear">
220220

221221
<footer>
222-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Tue Dec 21 2021 10:45:12 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
222+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Fri Jan 28 2022 16:38:20 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
223223
</footer>
224224

225225
<script>prettyPrint();</script>

docs/jsPDF-API.ShadingPattern.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ <h3 class="subsection-title">Extends</h3>
380380
<br class="clear">
381381

382382
<footer>
383-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Tue Dec 21 2021 10:45:12 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
383+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Fri Jan 28 2022 16:38:20 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
384384
</footer>
385385

386386
<script>prettyPrint();</script>

docs/jsPDF-API.TilingPattern.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ <h3 class="subsection-title">Extends</h3>
378378
<br class="clear">
379379

380380
<footer>
381-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Tue Dec 21 2021 10:45:12 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
381+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Fri Jan 28 2022 16:38:20 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
382382
</footer>
383383

384384
<script>prettyPrint();</script>

0 commit comments

Comments
 (0)