}
}
}
private void startPageLayout(Attributes attrs) {
PageLayout layout = new PageLayout();
layout.setPaperWidth(toQuantity(attrs.getValue("paper-width"), new Quantity(21, Unit.CM)));
layout.setPaperHeight(toQuantity(attrs.getValue("paper-height"), new Quantity(29.7, Unit.CM)));
layout.setTopMargin(toQuantity(attrs.getValue("top-margin")));
layout.setBottomMargin(toQuantity(attrs.getValue("bottom-margin")));
layout.setLeftMargin(toQuantity(attrs.getValue("left-margin")));
layout.setRightMargin(toQuantity(attrs.getValue("right-margin")));
String orientation = attrs.getValue("orientation");
if ("portrait".equals(orientation)) {
layout.setOrientation(PageLayout.PORTRAIT);
} else if ("landscape".equals(orientation)) {
layout.setOrientation(PageLayout.LANDSCAPE);
} else if ("reverse-landscape".equals(orientation)) {
layout.setOrientation(PageLayout.REVERSE_LANDSCAPE);
}
report.setPageLayout(layout);
}