attributes = new HashPrintRequestAttributeSet();
}
// for now, be lazy, assume that the first page is the reference
final PageDefinition pdef = report.getPageDefinition();
final PageFormat format = pdef.getPageFormat(0);
final Paper paper = format.getPaper();
final Media media = MediaSize.findMedia((float) (paper.getWidth() / POINTS_PER_INCH),
(float) (paper.getHeight() / POINTS_PER_INCH), Size2DSyntax.INCH);
attributes.add(media);
final MediaPrintableArea printableArea = new MediaPrintableArea
((float) (paper.getImageableX() / POINTS_PER_INCH),
(float) (paper.getImageableY() / POINTS_PER_INCH),
(float) (paper.getImageableWidth() / POINTS_PER_INCH),
(float) (paper.getImageableHeight() / POINTS_PER_INCH),
Size2DSyntax.INCH);
attributes.add(printableArea);
attributes.add(mapOrientation(format.getOrientation()));
return attributes;
}