Skip to content

Commit 15660c8

Browse files
committed
Merge pull request #375 from czarly/master
IE8 cannot access text.style.fontStyle
2 parents 460490a + 56a7556 commit 15660c8

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

jspdf.plugin.cell.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,20 @@
6464

6565
text = document.createElement('font');
6666
text.id = "jsPDFCell";
67-
text.style.fontStyle = fontStyle;
67+
68+
try {
69+
text.style.fontStyle = fontStyle;
70+
} catch(e) {
71+
text.style.fontWeight = fontStyle;
72+
}
73+
6874
text.style.fontName = fontName;
6975
text.style.fontSize = fontSize + 'pt';
70-
text.textContent = txt;
76+
try {
77+
text.textContent = txt;
78+
} catch(e) {
79+
text.innerText = txt;
80+
}
7181

7282
document.body.appendChild(text);
7383

0 commit comments

Comments
 (0)