Closed chrismaster closed 3 years ago
In the tutorial, you have an example of how to set a page style.
Without comments:
final PageStyle pageStyle = PageStyle.builder("page-style").header(header).footer(footer).build();
final TableStyle tableStyle = TableStyle.builder("table-style").pageStyle(pageStyle).build();
table.setStyle(tableStyle);
The PageStyleBuilder
class (first line) has the following methods:
marginBottom
, marginLeft
, marginRight
, marginTop
or allMargins
to sdet the margins;pageHeight
, pageWidth
or paperFormat
to set the page size.Try something like:
final PageStyle pageStyle = PageStyle.builder("page-style").allMargins(SimpleLength.cm(4)).paperFormat(PaperFormat.A3).build();
final TableStyle tableStyle = TableStyle.builder("table-style").pageStyle(pageStyle).build();
table.setStyle(tableStyle);
Guess it's okay.
Is there a way to set the page margin (top, bottom, left right, footer, header) and page size (mm,mm) ?