Skip to content

Commit f42d2d7

Browse files
committed
Readd defineable width and height properties for canvas
1 parent 6745888 commit f42d2d7

1 file changed

Lines changed: 20 additions & 22 deletions

File tree

plugins/canvas.js

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,28 @@
2626
this.pdf.context2d._canvas = this;
2727
return this.pdf.context2d;
2828
},
29-
style : {},
30-
width: 6000,
31-
height: 6000
29+
style : {}
3230
}
3331

34-
// Object.defineProperty(jsPDFAPI.canvas, 'width', {
35-
// get : function() {
36-
// return 10;//this._width;
37-
// },
38-
// set : function(value) {
39-
// this._width = value;
40-
// this.getContext('2d').pageWrapX = value + 1;
41-
// }
42-
// });
43-
//
44-
// Object.defineProperty(jsPDFAPI.canvas, 'height', {
45-
// get : function() {
46-
// return this._height;
47-
// },
48-
// set : function(value) {
49-
// this._height = value;
50-
// this.getContext('2d').pageWrapY = value + 1;
51-
// }
52-
// });
32+
Object.defineProperty(jsPDFAPI.canvas, 'width', {
33+
get : function() {
34+
return 10;//this._width;
35+
},
36+
set : function(value) {
37+
this._width = value;
38+
this.getContext('2d').pageWrapX = value + 1;
39+
}
40+
});
41+
42+
Object.defineProperty(jsPDFAPI.canvas, 'height', {
43+
get : function() {
44+
return this._height;
45+
},
46+
set : function(value) {
47+
this._height = value;
48+
this.getContext('2d').pageWrapY = value + 1;
49+
}
50+
});
5351

5452
return this;
5553
})(jsPDF.API);

0 commit comments

Comments
 (0)