虽然当然可以使用 BaseColor
,但默认情况下,它提供的选择非常有限。
我想知道如何将自定义颜色添加到文档中?
...
PdfPTable table = new PdfPTable(3);
PdfPCell cell = new PdfPCell(new Phrase("some clever text"));
cell.setBackgroundColor(BaseColor.GREEN);
table.addCell(cell);
...