OutputStream out) throws IOException {
try {
PageStore pageStore = new PageStore();
FontRenderContext frc = new FontRenderContext(null, true, true);
Formatter fmt = new Formatter(report, context, frc, pageStore);
PageLayout layout = report.getPageLayout();
Rectangle2D bounds = layout.getBounds(Unit.PT);
Rectangle2D drawable = layout.getDrawableArea(Unit.PT);
Paper paper = new Paper();
paper.setSize(bounds.getWidth(), bounds.getHeight());
paper.setImageableArea(drawable.getX(), drawable.getY(),
drawable.getWidth(), drawable.getHeight());
PageFormat pf = new PageFormat();