@@ -359,7 +359,7 @@ var jsPDF = (function (global) {
359
359
API . setCreationDate = function ( date ) {
360
360
setCreationDate ( date ) ;
361
361
return this ;
362
- }
362
+ } ;
363
363
364
364
/**
365
365
* @name getCreationDate
@@ -371,7 +371,7 @@ var jsPDF = (function (global) {
371
371
*/
372
372
API . getCreationDate = function ( type ) {
373
373
return getCreationDate ( type ) ;
374
- }
374
+ } ;
375
375
376
376
var padd2 = API . __private__ . padd2 = function ( number ) {
377
377
return ( '0' + parseInt ( number ) ) . slice ( - 2 ) ;
@@ -380,7 +380,13 @@ var jsPDF = (function (global) {
380
380
var padd2Hex = API . __private__ . padd2Hex = function ( hexString ) {
381
381
hexString = hexString . toString ( ) ;
382
382
return ( "00" + hexString ) . substr ( hexString . length ) ;
383
- }
383
+ } ;
384
+
385
+ var objectNumber = 0 ; // 'n' Current object number
386
+ var offsets = [ ] ; // List of offsets. Activated and reset by buildDocument(). Pupulated by various calls buildDocument makes.
387
+ var content = [ ] ;
388
+ var contentLength = 0 ;
389
+ var additionalObjects = [ ] ;
384
390
385
391
var pages = [ ] ;
386
392
var currentPage ;
@@ -639,12 +645,6 @@ var jsPDF = (function (global) {
639
645
return documentProperties [ key ] = value ;
640
646
} ;
641
647
642
- var objectNumber = 0 ; // 'n' Current object number
643
- var offsets = [ ] ; // List of offsets. Activated and reset by buildDocument(). Pupulated by various calls buildDocument makes.
644
- var content = [ ] ;
645
- var contentLength = 0 ;
646
- var additionalObjects = [ ] ;
647
-
648
648
var fonts = { } ; // collection of font objects, where key is fontKey - a dynamically created label for a given font.
649
649
var fontmap = { } ; // mapping structure fontName > fontStyle > font key - performance layer. See addFont()
650
650
var activeFontKey ; // will be string representing the KEY of the font as combination of fontName + fontStyle
@@ -893,7 +893,7 @@ var jsPDF = (function (global) {
893
893
this . ty = ! isNaN ( ty ) ? ty : 0 ;
894
894
895
895
return this ;
896
- }
896
+ } ;
897
897
898
898
/**
899
899
* Join the Matrix Values to a String
@@ -1132,7 +1132,8 @@ var jsPDF = (function (global) {
1132
1132
colorAsRGB += ( '0' + Math . floor ( parseFloat ( colorEncoded [ i ] ) * 255 ) . toString ( 16 ) ) . slice ( - 2 ) ;
1133
1133
}
1134
1134
return colorAsRGB ;
1135
- }
1135
+ } ;
1136
+
1136
1137
var encodeColorString = API . __private__ . encodeColorString = function ( options ) {
1137
1138
var color ;
1138
1139
@@ -1242,7 +1243,7 @@ var jsPDF = (function (global) {
1242
1243
if ( typeof jsPDF . API . processDataByFilters !== 'undefined' ) {
1243
1244
processedData = jsPDF . API . processDataByFilters ( data , filters ) ;
1244
1245
} else {
1245
- processedData = { data : data , reverseChain : [ ] }
1246
+ processedData = { data : data , reverseChain : [ ] } ;
1246
1247
}
1247
1248
var filterAsString = processedData . reverseChain + ( ( Array . isArray ( alreadyAppliedFilters ) ) ? alreadyAppliedFilters . join ( ' ' ) : alreadyAppliedFilters . toString ( ) ) ;
1248
1249
@@ -1347,7 +1348,8 @@ var jsPDF = (function (global) {
1347
1348
} ) ;
1348
1349
out ( 'endobj' ) ;
1349
1350
return pageObjectNumber ;
1350
- }
1351
+ } ;
1352
+
1351
1353
var putPages = API . __private__ . putPages = function ( ) {
1352
1354
var n , i , pageObjectNumbers = [ ] ;
1353
1355
@@ -1389,14 +1391,16 @@ var jsPDF = (function (global) {
1389
1391
var pdfEscapeWithNeededParanthesis = function ( text , flags ) {
1390
1392
var addParanthesis = text . indexOf ( ' ' ) !== - 1 ;
1391
1393
return ( addParanthesis ) ? '(' + pdfEscape ( text , flags ) + ')' : pdfEscape ( text , flags ) ;
1392
- }
1394
+ } ;
1395
+
1393
1396
events . publish ( 'putFont' , {
1394
1397
font : font ,
1395
1398
out : out ,
1396
1399
newObject : newObject ,
1397
1400
putStream : putStream ,
1398
1401
pdfEscapeWithNeededParanthesis : pdfEscapeWithNeededParanthesis
1399
1402
} ) ;
1403
+
1400
1404
if ( font . isAlreadyPutted !== true ) {
1401
1405
font . objectNumber = newObject ( ) ;
1402
1406
out ( '<<' ) ;
@@ -2055,7 +2059,8 @@ var jsPDF = (function (global) {
2055
2059
2056
2060
var getNumberOfPages = API . __private__ . getNumberOfPages = API . getNumberOfPages = function ( ) {
2057
2061
return pages . length - 1 ;
2058
- }
2062
+ } ;
2063
+
2059
2064
/**
2060
2065
* Returns a document-specific font key - a label assigned to a
2061
2066
* font name + font type combination at the time the font was added
@@ -2190,13 +2195,12 @@ var jsPDF = (function (global) {
2190
2195
} ;
2191
2196
2192
2197
var putXRef = API . __private__ . putXRef = function ( ) {
2193
- var i = 1 ;
2194
2198
var p = "0000000000" ;
2195
2199
2196
2200
out ( 'xref' ) ;
2197
2201
out ( '0 ' + ( objectNumber + 1 ) ) ;
2198
2202
out ( '0000000000 65535 f ' ) ;
2199
- for ( i = 1 ; i <= objectNumber ; i ++ ) {
2203
+ for ( var i = 1 ; i <= objectNumber ; i ++ ) {
2200
2204
var offset = offsets [ i ] ;
2201
2205
if ( typeof offset === 'function' ) {
2202
2206
out ( ( p + offsets [ i ] ( ) ) . slice ( - 10 ) + ' 00000 n ' ) ;
@@ -2718,7 +2722,7 @@ var jsPDF = (function (global) {
2718
2722
tmpTextIsOfTypeString = false ;
2719
2723
}
2720
2724
}
2721
- textIsOfTypeString = tmpTextIsOfTypeString
2725
+ textIsOfTypeString = tmpTextIsOfTypeString ;
2722
2726
}
2723
2727
if ( textIsOfTypeString === false ) {
2724
2728
throw new Error ( 'Type of text must be string or Array. "' + text + '" is not recognized.' ) ;
@@ -2873,7 +2877,7 @@ var jsPDF = (function (global) {
2873
2877
//if the coder wrote it explicitly to use a specific
2874
2878
//renderingMode, then use it
2875
2879
if ( renderingMode !== - 1 ) {
2876
- xtra += renderingMode + " Tr\n"
2880
+ xtra += renderingMode + " Tr\n" ;
2877
2881
//otherwise check if we used the rendering Mode already
2878
2882
//if so then set the rendering Mode...
2879
2883
} else if ( usedRenderingMode !== - 1 ) {
@@ -2888,7 +2892,6 @@ var jsPDF = (function (global) {
2888
2892
align = options . align || 'left' ;
2889
2893
var leading = activeFontSize * lineHeight ;
2890
2894
var pageWidth = scope . internal . pageSize . getWidth ( ) ;
2891
- var lineWidth = lineWidth ;
2892
2895
var activeFont = fonts [ activeFontKey ] ;
2893
2896
charSpace = options . charSpace || activeCharSpace ;
2894
2897
maxWidth = options . maxWidth || 0 ;
@@ -2953,8 +2956,6 @@ var jsPDF = (function (global) {
2953
2956
text = [ ] ;
2954
2957
len = da . length ;
2955
2958
for ( var h = 0 ; h < len ; h ++ ) {
2956
- newY = ( h === 0 ) ? getVerticalCoordinate ( y ) : - leading ;
2957
- newX = ( h === 0 ) ? getHorizontalCoordinate ( x ) : 0 ;
2958
2959
text . push ( da [ h ] ) ;
2959
2960
}
2960
2961
} else if ( align === "justify" ) {
@@ -3033,7 +3034,7 @@ var jsPDF = (function (global) {
3033
3034
position = f2 ( parmPosX ) + " " + f2 ( parmPosY ) + " Td\n" ;
3034
3035
}
3035
3036
return position ;
3036
- }
3037
+ } ;
3037
3038
3038
3039
for ( var lineIndex = 0 ; lineIndex < da . length ; lineIndex ++ ) {
3039
3040
@@ -3052,7 +3053,7 @@ var jsPDF = (function (global) {
3052
3053
break ;
3053
3054
}
3054
3055
3055
- if ( wordSpacingPerLine !== undefined && wordSpacingPerLine [ lineIndex ] !== undefined ) {
3056
+ if ( typeof wordSpacingPerLine !== ' undefined' && typeof wordSpacingPerLine [ lineIndex ] !== ' undefined' ) {
3056
3057
wordSpacing = wordSpacingPerLine [ lineIndex ] + " Tw\n" ;
3057
3058
}
3058
3059
@@ -3183,7 +3184,7 @@ var jsPDF = (function (global) {
3183
3184
result = true ;
3184
3185
}
3185
3186
return ( result ) ;
3186
- }
3187
+ } ;
3187
3188
3188
3189
var getStyle = API . __private__ . getStyle = API . getStyle = function ( style ) {
3189
3190
@@ -3990,7 +3991,7 @@ var jsPDF = (function (global) {
3990
3991
*/
3991
3992
API . __private__ . getStrokeColor = API . getDrawColor = function ( ) {
3992
3993
return decodeColorString ( strokeColor ) ;
3993
- }
3994
+ } ;
3994
3995
3995
3996
/**
3996
3997
* Sets the stroke color for upcoming elements.
@@ -4125,7 +4126,7 @@ var jsPDF = (function (global) {
4125
4126
*/
4126
4127
var getTextColor = API . __private__ . getTextColor = API . getTextColor = function ( ) {
4127
4128
return decodeColorString ( textColor ) ;
4128
- }
4129
+ } ;
4129
4130
/**
4130
4131
* Sets the text color for upcoming elements.
4131
4132
*
0 commit comments