List of usage examples for com.lowagie.text PageSize getRectangle
public static Rectangle getRectangle(String name)
From source file:ro.nextreports.engine.exporter.RtfExporter.java
License:Apache License
protected void initExport() throws QueryException { if (!bean.isSubreport()) { Padding margins = bean.getReportLayout().getPagePadding(); Rectangle rectangle;/*from ww w.ja v a 2 s . c o m*/ if (ReportLayout.CUSTOM.equals(bean.getReportLayout().getPageFormat())) { PaperSize customSize = bean.getReportLayout().getPaperSize(); rectangle = new Rectangle(customSize.getWidthPoints(), customSize.getHeightPoints()); } else { rectangle = PageSize.getRectangle(getPageFormat()); } document = new Document(rectangle, getPoints(margins.getLeft()), getPoints(margins.getRight()), getPoints(margins.getTop()), getPoints(margins.getBottom())); if (bean.getReportLayout().getOrientation() == LANDSCAPE) { document.setPageSize(rectangle.rotate()); } RtfWriter2 writer2 = RtfWriter2.getInstance(document, getOut()); } try { if (!bean.isSubreport()) { buildHeader(); buildFooter(); addMetaData(); document.open(); } table = buildRtfTable(PRINT_DOCUMENT); } catch (DocumentException e) { e.printStackTrace(); throw new QueryException(e); } }