use of com.itextpdf.layout.element.AreaBreak in project i7js-highlevel by itext.
the class TableProperties 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);
PdfFont font = PdfFontFactory.createFont(StandardFonts.TIMES_ROMAN);
Style style = new Style();
style.setBackgroundColor(ColorConstants.YELLOW);
document.add(createNewTable().addStyle(style).setDestination("Top").setWidth(300).setHorizontalAlignment(HorizontalAlignment.CENTER)).setHorizontalAlignment(HorizontalAlignment.CENTER);
document.add(createNewTable().setBorder(new DottedBorder(5)).setHyphenation(new HyphenationConfig("en", "uk", 3, 3)));
document.add(createNewTable().setTextAlignment(TextAlignment.CENTER));
document.add(ListSeparatorProperties.createNewSeparator().setMargin(10).setWidth(300).setKeepWithNext(true));
document.add(createNewTable().setKeepTogether(true).setWidth(UnitValue.createPercentValue(90)));
document.add(createNewTable());
document.add(createNewTable().setRelativePosition(10, 10, 50, 10));
document.add(createNewTable());
document.add(new AreaBreak());
document.add(createNewTable().setFixedPosition(100, 400, 350).setAction(PdfAction.createGoTo("Top")));
document.add(new AreaBreak());
document.add(createNewTable().setBackgroundColor(ColorConstants.YELLOW).setMarginBottom(10));
document.add(createNewTable().setBackgroundColor(ColorConstants.LIGHT_GRAY).setPaddingLeft(20).setPaddingRight(50));
document.add(createNewTable().setBackgroundColor(ColorConstants.YELLOW));
document.add(createNewTable().setBackgroundColor(ColorConstants.LIGHT_GRAY));
document.add(createNewTable().setBackgroundColor(ColorConstants.YELLOW));
document.add(createNewTable().setBackgroundColor(ColorConstants.LIGHT_GRAY).setMargin(50).setPadding(30));
document.add(createNewTable().setBackgroundColor(ColorConstants.YELLOW));
document.add(createNewTable().setBackgroundColor(ColorConstants.LIGHT_GRAY));
document.close();
}
Aggregations