Chunk amountLabel = new Chunk("Amount: ");
amountLabel.setFont(smallBold);
Chunk amountValue = new Chunk("Rs 25,000/-");
amountValue.setUnderline(0.1f, -2f); //0.1 thick, -2 y-location
amountValue.setFont(small);
Phrase phrase4 = new Phrase();
phrase4.add(amountLabel);
phrase4.add(amountValue);
PdfPCell cell5 = new PdfPCell(phrase4);
cell5.setBorder(Rectangle.NO_BORDER);
cell5.setPadding(padding);
cell5.setHorizontalAlignment(Element.ALIGN_RIGHT);
table.addCell(cell5);
在此,我需要一个方框来表示金额值,同时使用 itext 通过 java 生成 pdf,任何人都可以帮助我