2014年2月26日 星期三

java-itext-border

PdfPTable table = new PdfPTable(2);
PdfPCell cellOne = new PdfPCell(new Phrase("Hello"));
PdfPCell cellTwo = new PdfPCell(new Phrase("World"));

cellOne.setBorder(Rectangle.NO_BORDER);
cellOne.setBackgroundColor(new Color(255,255,45));

cellTwo.setBorder(Rectangle.BOX);

table.addCell(cellOne);
table.addCell(cellTwo);
If you want more detail about the Rectangle/Border values, take a look at the IText Constant values section for Rectangle, here : http://api.itextpdf.com/constant-values.html

沒有留言:

張貼留言