2013-04-04 73 views
0

在xPages中使用iText Library,如何調整列寬?如果我使用table.setWidths(30,10,30),我得到以下錯誤:error:com.ibm.jscript.InterpretException:腳本解釋器錯誤,行= 52,col = 7:Java方法'setWidths(number,number ,數字)'在Java類'com.itextpdf.text.pdf.PdfPTable'找不到在JavaScript中使用iText庫調整表列寬度,xPages

+0

什麼,最後曾經有一個有價值的尖端布賴恩中號穆爾(傳遞參數數組)的Java類var table = new com.itextpdf.text.pdf.PdfPTable(3); // 3列。 var widths:float = [150f,100f,150f]; table.setTotalWidth(widths); table.setLockedWidth(true); var cell1 = new com.itextpdf.text.pdf.PdfPCell(new com.itextpdf.text.Paragraph(「Table Cell 1」)); var cell2 = new com.itextpdf.text.pdf.PdfPCell(new com.itextpdf.text.Paragraph(「Table Cell 2」)); var cell3 = new com.itextpdf.text.pdf.PdfPCell(new com.itextpdf.text.Paragraph(「Table Cell 3」)); – user2246339 2013-04-05 16:48:31

回答

0

它看起來像setWidths預計浮動。這是否工作?

table.setWidths(parseFloat(30),parseFloat(10),parseFloat(30))

+0

使用table.setWidths(parseFloat(30),parseFloat(10),parseFloat(30)),我仍然得到相同的錯誤。 – user2246339 2013-04-04 19:42:18

1

總結你的代碼只需要調用一個函數機智流和文檔作爲參數