您好我正在使用JSPDF通過創建單元格來手動生成PDF。如何使JSPDF的單元格中心的文字
我必須指定單元格的高度,但是當文本的大小更多的則是過來拍打細胞。我怎樣才能避免這一點。
這裏是我的代碼:
var l = {
orientation: 'l',
unit: 'mm',
format: 'a4',
compress: true,
fontSize: 8,
lineHeight: 1,
autoSize: false,
printHeaders: true
}, pdf = new jsPDF(l, '', '', ''), i, j, margins = {
top: 30,
bottom: 10,
left: 10,
width: 25
};
//initializing the cells
pdf.cellInitialize();
var lines = pdf.splitTextToSize(' This is large icon to f', 12);
pdf.cell(margins.left, margins.top, 14, 8, lines, 0);
pdf.save('Te.pdf');
現在我可以增加細胞的高度,但文本仍然在圈細胞。
下面是它的樣子。
誰能幫我。我使用JSPDF https://github.com/MrRio/jsPDF
我甚至看過pdfmake,但它沒有提供任何文檔,也沒有說明它會支持IE8 + – Moiz
目前大多數選項都在[入門]中描述(http://pdfmake.org/#/gettingstarted) ... IE8 - 我將不得不考慮;) – bartekp
謝謝:) IE8是最大的問題。 – Moiz