How to set the paragraph of itext pdf file as rectangle with background color in Java
问题 I am designing a pdf report using itext library.I have implemented a paragraph in it.Now as per my requirement i have to set this paragraph inside rectangular box with background color but i am not able to do it.. Here is my Itext code in java... Font f = new Font(FontFamily.TIMES_ROMAN, 25.0f, Font.BOLD, BaseColor.CYAN); Paragraph p = new Paragraph("Total Cost:" + dbsumcallcost, f); document.add(p); Please guys help me. Thanks in advance.. 回答1: You need a Chunk to do that: Font f = new Font