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 に答える