use of com.itextpdf.layout.borders.DashedBorder in project i7js-highlevel by itext.
the class C05E06_CellBorders1 method createPdf.
public void createPdf(String dest) throws IOException {
// Initialize PDF document
PdfDocument pdf = new PdfDocument(new PdfWriter(dest));
// Initialize document
Document document = new Document(pdf);
Table table = new Table(UnitValue.createPercentArray(new float[] { 2, 1, 1 }));
table.setWidth(UnitValue.createPercentValue(80)).setHorizontalAlignment(HorizontalAlignment.CENTER).setTextAlignment(TextAlignment.CENTER);
table.addCell(new Cell(1, 3).add(new Paragraph("Cell with colspan 3")).setVerticalAlignment(VerticalAlignment.MIDDLE).setBorder(new DashedBorder(0.5f)));
table.addCell(new Cell(2, 1).add(new Paragraph("Cell with rowspan 2")).setVerticalAlignment(VerticalAlignment.MIDDLE).setBorderBottom(new DottedBorder(0.5f)).setBorderLeft(new DottedBorder(0.5f)));
table.addCell(new Cell().add(new Paragraph("row 1; cell 1")).setBorder(new DottedBorder(ColorConstants.ORANGE, 0.5f)));
table.addCell(new Cell().add(new Paragraph("row 1; cell 2")));
table.addCell(new Cell().add(new Paragraph("row 2; cell 1")).setBorderBottom(new SolidBorder(2)));
table.addCell(new Cell().add(new Paragraph("row 2; cell 2")).setBorderBottom(new SolidBorder(2)));
document.add(table);
document.close();
}
use of com.itextpdf.layout.borders.DashedBorder in project i7js-highlevel by itext.
the class C05E04_ColumnHeights method createPdf.
public void createPdf(String dest) throws IOException {
// Initialize PDF document
PdfDocument pdf = new PdfDocument(new PdfWriter(dest));
Paragraph p = new Paragraph("The Strange Case of\nDr. Jekyll\nand\nMr. Hyde").setBorder(new DashedBorder(0.3f));
// Initialize document
Document document = new Document(pdf);
Table table = new Table(UnitValue.createPercentArray(new float[] { 1 }));
table.setWidth(UnitValue.createPercentValue(100));
table.addCell(p);
Cell cell = new Cell().setHeight(45).add(p);
table.addCell(cell);
cell = new Cell().setMinHeight(45).add(p);
table.addCell(cell);
cell = new Cell().setMinHeight(135).add(p);
table.addCell(cell);
cell = new Cell().setMaxHeight(45).add(p);
table.addCell(cell);
cell = new Cell().setMaxHeight(135).add(p);
table.addCell(cell);
cell = new Cell().add(p).setRotationAngle(Math.PI / 6);
table.addCell(cell);
document.add(table);
document.close();
}
Aggregations