Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
PdfContentByteを使用してオブジェクトにコンテンツを直接PdfContentByte.showTextAligned書き込んでいます。書き込み時にテキストが特定の領域からはみ出すのを防ぐ方法を知りたいです。
PdfContentByte
PdfContentByte.showTextAligned
可能であれば、iText がテキストが収まらない場所に省略記号を配置できるとよいでしょう。
ColumnTextどちらにも役立つ方法が見つかりません。書き込み時にコンテンツが折り返されないようにします。
ColumnText
これを使って:
int status = ColumnText.START_COLUMN; ColumnText ct = new ColumnText(cb); ct.setSimpleColumn(rectangle); status = ct.go();
rectangle1 行だけが収まるように定義してくださいColumnText.hasMoreText(status)。省略記号を追加する必要があるかどうかを調べるために使用してください。
rectangle
ColumnText.hasMoreText(status)