开发者

How to make the text inside a specific cell of a table bold in PDF using Java?

I'm creating a PDF document and inside of it i'm creating a table.

I want some cells to have bold text style.

How can thi开发者_JAVA技巧s be done?


Before adding text to the cell, Create a new paragraph with the text you want to add.

Paragraph paragraph=new Paragraph("Test in the Cell");

paragraph.getFont().setStyle(Font.BOLD);

Cell c=new Cell(paragraph);

table.addCell(c);

For those Cells in which you need not want the bold just simply remove the line paragraph.getFont().setStyle(Font.BOLD);

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜