1
1
/** @preserve
2
2
* jsPDF - PDF Document creation from JavaScript
3
- * Version 1.0.115 -git Built on 2014-04-25T11:37
4
- * CommitID a73ecd3aa1
3
+ * Version 1.0.116 -git Built on 2014-04-26T23:20
4
+ * CommitID cb7dcd4c77
5
5
*
6
6
* Copyright (c) 2010-2014 James Hall, https://github.com/MrRio/jsPDF
7
7
* 2010 Aaron Spike, https://github.com/acspike
@@ -1002,10 +1002,7 @@ var jsPDF = (function(global) {
1002
1002
} ;
1003
1003
1004
1004
API . line = function ( x1 , y1 , x2 , y2 ) {
1005
- out (
1006
- f2 ( x1 * k ) + ' ' + f2 ( ( pageHeight - y1 ) * k ) + ' m ' +
1007
- f2 ( x2 * k ) + ' ' + f2 ( ( pageHeight - y2 ) * k ) + ' l S' ) ;
1008
- return this ;
1005
+ return this . lines ( [ [ x2 - x1 , y2 - y1 ] ] , x1 , y1 ) ;
1009
1006
} ;
1010
1007
1011
1008
/**
@@ -1696,7 +1693,7 @@ var jsPDF = (function(global) {
1696
1693
* pdfdoc.mymethod() // <- !!!!!!
1697
1694
*/
1698
1695
jsPDF . API = { events :[ ] } ;
1699
- jsPDF . version = "1.0.115 -debug 2014-04-25T11:37:jameshall " ;
1696
+ jsPDF . version = "1.0.116 -debug 2014-04-26T23:20:diegocr " ;
1700
1697
1701
1698
if ( typeof define === 'function' ) {
1702
1699
define ( function ( ) {
@@ -2081,7 +2078,7 @@ var jsPDF = (function(global) {
2081
2078
* Check to see if ArrayBuffer is supported
2082
2079
*/
2083
2080
jsPDFAPI . supportsArrayBuffer = function ( ) {
2084
- return typeof ArrayBuffer === 'function' ;
2081
+ return typeof ArrayBuffer === 'function' && typeof Uint8Array !== 'undefined' ;
2085
2082
} ;
2086
2083
2087
2084
/**
@@ -2101,9 +2098,11 @@ var jsPDF = (function(global) {
2101
2098
jsPDFAPI . isArrayBufferView = function ( object ) {
2102
2099
if ( ! this . supportsArrayBuffer ( ) )
2103
2100
return false ;
2101
+ if ( typeof Uint32Array === 'undefined' )
2102
+ return false ;
2104
2103
return ( object instanceof Int8Array ||
2105
2104
object instanceof Uint8Array ||
2106
- object instanceof Uint8ClampedArray ||
2105
+ ( typeof Uint8ClampedArray !== 'undefined' && object instanceof Uint8ClampedArray ) ||
2107
2106
object instanceof Int16Array ||
2108
2107
object instanceof Uint16Array ||
2109
2108
object instanceof Int32Array ||
@@ -3766,9 +3765,9 @@ var jsPDF = (function(global) {
3766
3765
img , dp , trns ,
3767
3766
colors , pal , smask ;
3768
3767
3769
- if ( this . isString ( imageData ) ) {
3768
+ /* if(this.isString(imageData)) {
3770
3769
3771
- }
3770
+ }*/
3772
3771
3773
3772
if ( this . isArrayBuffer ( imageData ) )
3774
3773
imageData = new Uint8Array ( imageData ) ;
@@ -3928,7 +3927,7 @@ var jsPDF = (function(global) {
3928
3927
bpc , decode , imageIndex , alias , dp , trns , pal , smask ) ;
3929
3928
}
3930
3929
3931
- return info ;
3930
+ throw new Error ( "Unsupported PNG image data, try using JPEG instead." ) ;
3932
3931
}
3933
3932
3934
3933
} ) ( jsPDF . API )
@@ -8532,26 +8531,26 @@ var FlateStream = (function() {
8532
8531
return dec ;
8533
8532
} ;
8534
8533
}
8535
-
8536
- if ( ! Array . prototype . map ) {
8537
- Array . prototype . map = function ( fun /*, thisArg */ ) {
8538
- if ( this === void 0 || this === null || typeof fun !== "function" )
8534
+
8535
+ if ( ! Array . prototype . map ) {
8536
+ Array . prototype . map = function ( fun /*, thisArg */ ) {
8537
+ if ( this === void 0 || this === null || typeof fun !== "function" )
8539
8538
throw new TypeError ( ) ;
8540
-
8541
- var t = Object ( this ) , len = t . length >>> 0 , res = new Array ( len ) ;
8542
- var thisArg = arguments . length > 1 ? arguments [ 1 ] : void 0 ;
8543
- for ( var i = 0 ; i < len ; i ++ ) {
8544
- // NOTE: Absolute correctness would demand Object.defineProperty
8545
- // be used. But this method is fairly new, and failure is
8546
- // possible only if Object.prototype or Array.prototype
8547
- // has a property |i| (very unlikely), so use a less-correct
8548
- // but more portable alternative.
8549
- if ( i in t )
8550
- res [ i ] = fun . call ( thisArg , t [ i ] , i , t ) ;
8551
- }
8552
-
8553
- return res ;
8554
- } ;
8539
+
8540
+ var t = Object ( this ) , len = t . length >>> 0 , res = new Array ( len ) ;
8541
+ var thisArg = arguments . length > 1 ? arguments [ 1 ] : void 0 ;
8542
+ for ( var i = 0 ; i < len ; i ++ ) {
8543
+ // NOTE: Absolute correctness would demand Object.defineProperty
8544
+ // be used. But this method is fairly new, and failure is
8545
+ // possible only if Object.prototype or Array.prototype
8546
+ // has a property |i| (very unlikely), so use a less-correct
8547
+ // but more portable alternative.
8548
+ if ( i in t )
8549
+ res [ i ] = fun . call ( thisArg , t [ i ] , i , t ) ;
8550
+ }
8551
+
8552
+ return res ;
8553
+ } ;
8555
8554
}
8556
8555
8557
8556
if ( ! Array . prototype . forEach ) {
@@ -8568,55 +8567,55 @@ var FlateStream = (function() {
8568
8567
}
8569
8568
} ;
8570
8569
}
8571
-
8572
- if ( ! Object . keys ) {
8573
- Object . keys = ( function ( ) {
8570
+
8571
+ if ( ! Object . keys ) {
8572
+ Object . keys = ( function ( ) {
8574
8573
'use strict' ;
8575
-
8576
- var hasOwnProperty = Object . prototype . hasOwnProperty ,
8577
- hasDontEnumBug = ! ( { toString : null } ) . propertyIsEnumerable ( 'toString' ) ,
8578
- dontEnums = [ 'toString' , 'toLocaleString' , 'valueOf' , 'hasOwnProperty' ,
8579
- 'isPrototypeOf' , 'propertyIsEnumerable' , 'constructor' ] ,
8574
+
8575
+ var hasOwnProperty = Object . prototype . hasOwnProperty ,
8576
+ hasDontEnumBug = ! ( { toString : null } ) . propertyIsEnumerable ( 'toString' ) ,
8577
+ dontEnums = [ 'toString' , 'toLocaleString' , 'valueOf' , 'hasOwnProperty' ,
8578
+ 'isPrototypeOf' , 'propertyIsEnumerable' , 'constructor' ] ,
8580
8579
dontEnumsLength = dontEnums . length ;
8581
-
8582
- return function ( obj ) {
8583
- if ( typeof obj !== 'object' && ( typeof obj !== 'function' || obj === null ) ) {
8584
- throw new TypeError ( ) ;
8585
- }
8580
+
8581
+ return function ( obj ) {
8582
+ if ( typeof obj !== 'object' && ( typeof obj !== 'function' || obj === null ) ) {
8583
+ throw new TypeError ( ) ;
8584
+ }
8586
8585
var result = [ ] , prop , i ;
8587
-
8588
- for ( prop in obj ) {
8589
- if ( hasOwnProperty . call ( obj , prop ) ) {
8590
- result . push ( prop ) ;
8591
- }
8586
+
8587
+ for ( prop in obj ) {
8588
+ if ( hasOwnProperty . call ( obj , prop ) ) {
8589
+ result . push ( prop ) ;
8590
+ }
8591
+ }
8592
+
8593
+ if ( hasDontEnumBug ) {
8594
+ for ( i = 0 ; i < dontEnumsLength ; i ++ ) {
8595
+ if ( hasOwnProperty . call ( obj , dontEnums [ i ] ) ) {
8596
+ result . push ( dontEnums [ i ] ) ;
8597
+ }
8598
+ }
8592
8599
}
8593
-
8594
- if ( hasDontEnumBug ) {
8595
- for ( i = 0 ; i < dontEnumsLength ; i ++ ) {
8596
- if ( hasOwnProperty . call ( obj , dontEnums [ i ] ) ) {
8597
- result . push ( dontEnums [ i ] ) ;
8598
- }
8599
- }
8600
- }
8601
- return result ;
8602
- } ;
8603
- } ( ) ) ;
8600
+ return result ;
8601
+ } ;
8602
+ } ( ) ) ;
8604
8603
}
8605
8604
8606
- if ( ! String . prototype . trim ) {
8607
- String . prototype . trim = function ( ) {
8608
- return this . replace ( / ^ \s + | \s + $ / g, '' ) ;
8609
- } ;
8610
- }
8611
- if ( ! String . prototype . trimLeft ) {
8612
- String . prototype . trimLeft = function ( ) {
8613
- return this . replace ( / ^ \s + / g, "" ) ;
8614
- } ;
8615
- }
8616
- if ( ! String . prototype . trimRight ) {
8617
- String . prototype . trimRight = function ( ) {
8618
- return this . replace ( / \s + $ / g, "" ) ;
8619
- } ;
8605
+ if ( ! String . prototype . trim ) {
8606
+ String . prototype . trim = function ( ) {
8607
+ return this . replace ( / ^ \s + | \s + $ / g, '' ) ;
8608
+ } ;
8609
+ }
8610
+ if ( ! String . prototype . trimLeft ) {
8611
+ String . prototype . trimLeft = function ( ) {
8612
+ return this . replace ( / ^ \s + / g, "" ) ;
8613
+ } ;
8620
8614
}
8621
-
8622
- } ) ( self ) ;
8615
+ if ( ! String . prototype . trimRight ) {
8616
+ String . prototype . trimRight = function ( ) {
8617
+ return this . replace ( / \s + $ / g, "" ) ;
8618
+ } ;
8619
+ }
8620
+
8621
+ } ) ( this ) ;
0 commit comments