11/** @preserve
22 * 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
55 *
66 * Copyright (c) 2010-2014 James Hall, https://github.com/MrRio/jsPDF
77 * 2010 Aaron Spike, https://github.com/acspike
@@ -1693,7 +1693,7 @@ var jsPDF = (function(global) {
16931693 * pdfdoc.mymethod() // <- !!!!!!
16941694 */
16951695 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" ;
16971697
16981698 if ( typeof define === 'function' ) {
16991699 define ( function ( ) {
@@ -2440,7 +2440,7 @@ var jsPDF = (function(global) {
24402440 return this ;
24412441 } ;
24422442} ) ( jsPDF . API ) ;
2443- /** ====================================================================
2443+ /** ====================================================================
24442444 * jsPDF Cell plugin
24452445 * Copyright (c) 2013 Youssef Beddad, [email protected] 24462446 * 2013 Eduardo Menezes de Morais, [email protected] @@ -2456,10 +2456,10 @@ var jsPDF = (function(global) {
24562456 * distribute, sublicense, and/or sell copies of the Software, and to
24572457 * permit persons to whom the Software is furnished to do so, subject to
24582458 * the following conditions:
2459- *
2459+ *
24602460 * The above copyright notice and this permission notice shall be
24612461 * included in all copies or substantial portions of the Software.
2462- *
2462+ *
24632463 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24642464 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24652465 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -2488,7 +2488,8 @@ var jsPDF = (function(global) {
24882488 } ,
24892489 getLastCellPosition = function ( ) {
24902490 return lastCellPos ;
2491- } ;
2491+ } ,
2492+ NO_MARGINS = { left :0 , top :0 , bottom : 0 } ;
24922493
24932494 jsPDFAPI . setHeaderFunction = function ( func ) {
24942495 headerFunction = func ;
@@ -2520,9 +2521,11 @@ var jsPDF = (function(global) {
25202521 } ;
25212522
25222523 jsPDFAPI . cellAddPage = function ( ) {
2524+ var margins = this . margins || NO_MARGINS ;
2525+
25232526 this . addPage ( ) ;
25242527
2525- setLastCellPosition ( this . margins . left , this . margins . top , undefined , undefined ) ;
2528+ setLastCellPosition ( margins . left , margins . top , undefined , undefined ) ;
25262529 //setLastCellPosition(undefined, undefined, undefined, undefined, undefined);
25272530 pages += 1 ;
25282531 } ;
@@ -2543,7 +2546,8 @@ var jsPDF = (function(global) {
25432546 y = curCell . y ;
25442547 } else {
25452548 //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 ) {
25472551 this . cellAddPage ( ) ;
25482552 if ( this . printHeaders && this . tableHeaderRow ) {
25492553 this . printHeaderRow ( ln , true ) ;
@@ -2645,7 +2649,9 @@ var jsPDF = (function(global) {
26452649 autoSize = false ,
26462650 printHeaders = true ,
26472651 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 ;
26492655
26502656 if ( config ) {
26512657 //override config defaults if the user has specified non-default behavior:
@@ -2812,7 +2818,7 @@ var jsPDF = (function(global) {
28122818
28132819 tableHeaderCell = this . tableHeaderRow [ i ] ;
28142820 if ( new_page ) {
2815- tableHeaderCell [ 1 ] = this . margins . top ;
2821+ tableHeaderCell [ 1 ] = this . margins && this . margins . top || 0 ;
28162822 tempHeaderConf . push ( tableHeaderCell ) ;
28172823 }
28182824 tmpArray = [ ] . concat ( tableHeaderCell ) ;
0 commit comments