Skip to content

Commit 157527d

Browse files
committed
Fixed #96
1 parent 84b6204 commit 157527d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

jspdf.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,10 @@ var jsPDF = (function(global) {
931931
* T* (line three) Tj
932932
* ET
933933
*/
934+
function ESC(s) {
935+
s = s.split("\t").join(Array(options.TabLen||9).join(" "));
936+
return pdfEscape(s, flags);
937+
}
934938

935939
// Pre-August-2012 the order of arguments was function(x, y, text, flags)
936940
// in effort to make all calls have similar signature like
@@ -970,14 +974,14 @@ var jsPDF = (function(global) {
970974
flags.autoencode = true;
971975

972976
if (typeof text === 'string') {
973-
text = pdfEscape(text, flags);
977+
text = ESC(text);
974978
} else if (text instanceof Array) {
975979
// we don't want to destroy original text array, so cloning it
976980
var sa = text.concat(), da = [], len = sa.length;
977981
// we do array.join('text that must not be PDFescaped")
978982
// thus, pdfEscape each component separately
979983
while (len--) {
980-
da.push(pdfEscape(sa.shift(), flags));
984+
da.push(ESC(sa.shift()));
981985
}
982986
text = da.join(") Tj\nT* (");
983987
} else {

0 commit comments

Comments
 (0)