Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions jspdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ var jsPDF = (function (global) {
out('endstream');
},
putPages = function () {
var n, p, arr, i, deflater, adler32, adler32cs, wPt, hPt;
var n, p, arr, i, deflater, adler32, adler32cs, wPt, hPt, pageObjectNumbers = [];

adler32cs = global.adler32cs || jsPDF.adler32cs;
if (compress && typeof adler32cs === 'undefined') {
Expand All @@ -270,7 +270,7 @@ var jsPDF = (function (global) {
// outToPages = false as set in endDocument(). out() writes to content.

for (n = 1; n <= page; n++) {
newObject();
pageObjectNumbers.push(newObject());
wPt = (pageWidth = pagedim[n].width) * k;
hPt = (pageHeight = pagedim[n].height) * k;
out('<</Type /Page');
Expand Down Expand Up @@ -313,7 +313,7 @@ var jsPDF = (function (global) {
out('<</Type /Pages');
var kids = '/Kids [';
for (i = 0; i < page; i++) {
kids += (3 + 2 * i) + ' 0 R ';
kids += pageObjectNumbers[i] + ' 0 R ';
}
out(kids + ']');
out('/Count ' + page);
Expand Down
9 changes: 8 additions & 1 deletion plugins/acroform.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
type: 'reference',
object: object
};
jsPDF.API.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push(options);
jsPDF.API.annotationPlugin.annotations[this.internal.getPageInfo(object.page).pageNumber].push(options);
};

var putForm = function (formObject) {
Expand Down Expand Up @@ -245,6 +245,7 @@
// try to put..
putForm.call(this, fieldObject);
}
fieldObject.page = this.acroformPlugin.internal.getCurrentPageInfo().pageNumber;
return this;
};

Expand Down Expand Up @@ -1050,6 +1051,12 @@ AcroForm.Field = function () {
configurable: true,
writable: true
});

Object.defineProperty(this, 'page', {
enumerable: false,
configurable: true,
writable: true
});
};
AcroForm.Field.FieldNum = 0;

Expand Down