File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -968,7 +968,7 @@ var jsPDF = (function(global) {
968
968
angle = flags ;
969
969
flags = null ;
970
970
}
971
- var xtra = '' , mode = 'Td' ;
971
+ var xtra = '' , mode = 'Td' , todo ;
972
972
if ( angle ) {
973
973
angle *= ( Math . PI / 180 ) ;
974
974
var c = Math . cos ( angle ) ,
@@ -992,6 +992,10 @@ var jsPDF = (function(global) {
992
992
while ( len -- ) {
993
993
da . push ( ESC ( sa . shift ( ) ) ) ;
994
994
}
995
+ var linesLeft = Math . ceil ( ( pageHeight - y ) * k / ( activeFontSize * lineHeightProportion ) ) ;
996
+ if ( 0 <= linesLeft && linesLeft < da . length + 1 ) {
997
+ todo = da . splice ( linesLeft - 1 ) ;
998
+ }
995
999
text = da . join ( ") Tj\nT* (" ) ;
996
1000
} else {
997
1001
throw new Error ( 'Type of text must be string or Array. "' + text + '" is not recognized.' ) ;
@@ -1011,6 +1015,12 @@ var jsPDF = (function(global) {
1011
1015
'\n' + xtra + f2 ( x * k ) + ' ' + f2 ( ( pageHeight - y ) * k ) + ' ' + mode + '\n(' +
1012
1016
text +
1013
1017
') Tj\nET' ) ;
1018
+
1019
+ if ( todo ) {
1020
+ this . addPage ( ) ;
1021
+ this . text ( todo , x , activeFontSize * 1.7 / k ) ;
1022
+ }
1023
+
1014
1024
return this ;
1015
1025
} ;
1016
1026
You can’t perform that action at this time.
0 commit comments