1
1
/** @preserve
2
2
* jsPDF - PDF Document creation from JavaScript
3
- * Version 1.0.131 -git Built on 2014-05-11T20:51
4
- * CommitID 9ca4a6ded0
3
+ * Version 1.0.133 -git Built on 2014-05-13T00:23
4
+ * CommitID 4952bd270a
5
5
*
6
6
* Copyright (c) 2010-2014 James Hall, https://github.com/MrRio/jsPDF
7
7
* 2010 Aaron Spike, https://github.com/acspike
@@ -1693,7 +1693,7 @@ var jsPDF = (function(global) {
1693
1693
* pdfdoc.mymethod() // <- !!!!!!
1694
1694
*/
1695
1695
jsPDF . API = { events :[ ] } ;
1696
- jsPDF . version = "1.0.131 -debug 2014-05-11T20:51 :diegocr" ;
1696
+ jsPDF . version = "1.0.133 -debug 2014-05-13T00:23 :diegocr" ;
1697
1697
1698
1698
if ( typeof define === 'function' ) {
1699
1699
define ( function ( ) {
@@ -2440,7 +2440,7 @@ var jsPDF = (function(global) {
2440
2440
return this ;
2441
2441
} ;
2442
2442
} ) ( jsPDF . API ) ;
2443
- /** ====================================================================
2443
+ /** ====================================================================
2444
2444
* jsPDF Cell plugin
2445
2445
* Copyright (c) 2013 Youssef Beddad, [email protected]
2446
2446
* 2013 Eduardo Menezes de Morais, [email protected]
@@ -2456,10 +2456,10 @@ var jsPDF = (function(global) {
2456
2456
* distribute, sublicense, and/or sell copies of the Software, and to
2457
2457
* permit persons to whom the Software is furnished to do so, subject to
2458
2458
* the following conditions:
2459
- *
2459
+ *
2460
2460
* The above copyright notice and this permission notice shall be
2461
2461
* included in all copies or substantial portions of the Software.
2462
- *
2462
+ *
2463
2463
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
2464
2464
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2465
2465
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -2488,7 +2488,8 @@ var jsPDF = (function(global) {
2488
2488
} ,
2489
2489
getLastCellPosition = function ( ) {
2490
2490
return lastCellPos ;
2491
- } ;
2491
+ } ,
2492
+ NO_MARGINS = { left :0 , top :0 , bottom : 0 } ;
2492
2493
2493
2494
jsPDFAPI . setHeaderFunction = function ( func ) {
2494
2495
headerFunction = func ;
@@ -2520,9 +2521,11 @@ var jsPDF = (function(global) {
2520
2521
} ;
2521
2522
2522
2523
jsPDFAPI . cellAddPage = function ( ) {
2524
+ var margins = this . margins || NO_MARGINS ;
2525
+
2523
2526
this . addPage ( ) ;
2524
2527
2525
- setLastCellPosition ( this . margins . left , this . margins . top , undefined , undefined ) ;
2528
+ setLastCellPosition ( margins . left , margins . top , undefined , undefined ) ;
2526
2529
//setLastCellPosition(undefined, undefined, undefined, undefined, undefined);
2527
2530
pages += 1 ;
2528
2531
} ;
@@ -2543,7 +2546,8 @@ var jsPDF = (function(global) {
2543
2546
y = curCell . y ;
2544
2547
} else {
2545
2548
//New line
2546
- if ( ( curCell . y + curCell . h + h + margin ) >= this . internal . pageSize . height - this . margins . bottom ) {
2549
+ var margins = this . margins || NO_MARGINS ;
2550
+ if ( ( curCell . y + curCell . h + h + margin ) >= this . internal . pageSize . height - margins . bottom ) {
2547
2551
this . cellAddPage ( ) ;
2548
2552
if ( this . printHeaders && this . tableHeaderRow ) {
2549
2553
this . printHeaderRow ( ln , true ) ;
@@ -2645,7 +2649,9 @@ var jsPDF = (function(global) {
2645
2649
autoSize = false ,
2646
2650
printHeaders = true ,
2647
2651
fontSize = 12 ,
2648
- margins = { left :0 , top :0 , bottom : 0 , width : this . internal . pageSize . width } ;
2652
+ margins = NO_MARGINS ;
2653
+
2654
+ margins . width = this . internal . pageSize . width ;
2649
2655
2650
2656
if ( config ) {
2651
2657
//override config defaults if the user has specified non-default behavior:
@@ -2812,7 +2818,7 @@ var jsPDF = (function(global) {
2812
2818
2813
2819
tableHeaderCell = this . tableHeaderRow [ i ] ;
2814
2820
if ( new_page ) {
2815
- tableHeaderCell [ 1 ] = this . margins . top ;
2821
+ tableHeaderCell [ 1 ] = this . margins && this . margins . top || 0 ;
2816
2822
tempHeaderConf . push ( tableHeaderCell ) ;
2817
2823
}
2818
2824
tmpArray = [ ] . concat ( tableHeaderCell ) ;
0 commit comments