我编写了下面的代码来使用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“列的长字符串拆分成多行。有什么解决方案吗?
发布于 2014-10-11 02:28:17
您是否尝试过使用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
https://stackoverflow.com/questions/23625300
复制相似问题