// step4
// page 1
LwgFont tableFont = FontFactory.getFont("Helvetica", 8, LwgFont.BOLD, Color.BLACK);
float padding = 0f;
LwgRectangle border = new LwgRectangle(0f, 0f);
border.setBorderWidthLeft(6f);
border.setBorderWidthBottom(5f);
border.setBorderWidthRight(4f);
border.setBorderWidthTop(2f);
border.setBorderColorLeft(Color.RED);
border.setBorderColorBottom(Color.ORANGE);
border.setBorderColorRight(Color.YELLOW);
border.setBorderColorTop(Color.GREEN);
makeTestPage(tableFont, border, writer, document, padding, true, true);
LwgFont font = FontFactory.getFont("Helvetica", 10);
Paragraph p;
p = new Paragraph("\nVarious border widths and colors\nuseAscender=true, useDescender=true", font);
document.add(p);
document.newPage();
// page 2
padding = 2f;
border = new LwgRectangle(0f, 0f);
border.setBorderWidthLeft(1f);
border.setBorderWidthBottom(2f);
border.setBorderWidthRight(1f);
border.setBorderWidthTop(2f);
border.setBorderColor(Color.BLACK);
makeTestPage(tableFont, border, writer, document, padding, true, true);
p = new Paragraph("More typical use - padding of 2\nuseBorderPadding=true, useAscender=true, useDescender=true", font);
document.add(p);
document.newPage();
// page 3
padding = 0f;
border = new LwgRectangle(0f, 0f);
border.setBorderWidthLeft(1f);
border.setBorderWidthBottom(2f);
border.setBorderWidthRight(1f);
border.setBorderWidthTop(2f);
border.setBorderColor(Color.BLACK);
makeTestPage(tableFont, border, writer, document, padding, false, true);
p = new Paragraph("\nuseBorderPadding=true, useAscender=false, useDescender=true", font);
document.add(p);
document.newPage();
// page 4
padding = 0f;
border = new LwgRectangle(0f, 0f);
border.setBorderWidthLeft(1f);
border.setBorderWidthBottom(2f);
border.setBorderWidthRight(1f);
border.setBorderWidthTop(2f);
border.setBorderColor(Color.BLACK);
makeTestPage(tableFont, border, writer, document, padding, false, false);
p = new Paragraph("\nuseBorderPadding=true, useAscender=false, useDescender=false", font);
document.add(p);
document.newPage();
// page 5
padding = 0f;
border = new LwgRectangle(0f, 0f);
border.setBorderWidthLeft(1f);
border.setBorderWidthBottom(2f);
border.setBorderWidthRight(1f);
border.setBorderWidthTop(2f);
border.setBorderColor(Color.BLACK);
makeTestPage(tableFont, border, writer, document, padding, true, false);
p = new Paragraph("\nuseBorderPadding=true, useAscender=true, useDescender=false", font);
document.add(p);
} catch (Exception de) {
de.printStackTrace();