0

我编写下面的代码来声明一个带有 sharpPDF 的表格行。

pdfTableRow tableRow = resultTable.createRow();
tableRow[0].columnValue = "123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789";
tableRow[1].columnValue = "OK";
resultTable.rowStyle = new pdfTableRowStyle(predefinedFont.csCourier, 8, new pdfColor(predefinedColor.csBlack), new pdfColor(predefinedColor.csWhite));

有了这个结果: 在此处输入图像描述

我想将“Fase”列的长字符串分成或更多行。有什么解决办法吗?

4

1 回答 1

0

您是否尝试过使用 addParagraph 来换行文本?

sharpPDF.Tables.pdfTableRow row = tbl.createRow(); // tbl is a pdfTable with columns
int iLineHeight = 12; // Height of line for wrapping
row[0].addParagraph("Your long string goes here and will wrap.", iLineHeight, sharpPDF.Enumerators.predefinedAlignment.csLeft);

来源:http: //sourceforge.net/p/sharppdf/discussion/366672/thread/bd3e5b23

于 2014-10-10T18:28:16.660 回答