Skip to content

Commit 68baeff

Browse files
committed
Fix buildDocument corrupting after second call (issue #626)
Calling buildDocument resulted in content_length being set to NaN, as instead of passing a string to the internal 'out' function, a number was passed in the last call. Since content_length was being added onto each time, this last call corrupts all subsequent document builds. Also, since content_length was not reset after the call, subsequent calls would have compounded length even if the document wasn't corrupted.
1 parent 76c004c commit 68baeff

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

dist/jspdf.debug.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
/** @preserve
1414
* jsPDF - PDF Document creation from JavaScript
15-
* Version 1.2.61 Built on 2016-09-17T14:06:27.123Z
16-
* CommitID 71f29bc30e
15+
* Version 1.2.61 Built on 2016-09-21T03:47:23.229Z
16+
* CommitID 811fbb2f6a
1717
*
1818
* Copyright (c) 2010-2014 James Hall <[email protected]>, https://github.com/MrRio/jsPDF
1919
* 2010 Aaron Spike, https://github.com/acspike
@@ -833,6 +833,7 @@
833833
outToPages = false; // switches out() to content
834834

835835
objectNumber = 2;
836+
content_length = 0;
836837
content = [];
837838
offsets = [];
838839
additionalObjects = [];
@@ -885,7 +886,7 @@
885886
putTrailer();
886887
out('>>');
887888
out('startxref');
888-
out(o);
889+
out('' + o);
889890
out('%%EOF');
890891

891892
outToPages = true;
@@ -2028,7 +2029,7 @@
20282029
* pdfdoc.mymethod() // <- !!!!!!
20292030
*/
20302031
jsPDF.API = { events: [] };
2031-
jsPDF.version = "1.2.61 2016-09-17T14:06:27.123Z:steven";
2032+
jsPDF.version = "1.2.61 2016-09-21T03:47:23.229Z:albert";
20322033

20332034
if (typeof define === 'function' && define.amd) {
20342035
define('jsPDF', function () {

0 commit comments

Comments
 (0)