BufferedImage image = new BufferedImage(pageWidth,
pageHeight,
transparent?BufferedImage.TYPE_INT_ARGB:BufferedImage.TYPE_INT_RGB);
Graphics g = image.createGraphics();
if (!transparent) {
PRectangle pageBoundary = page.getPageBoundary(Page.BOUNDARY_CROPBOX);
float x = 0 - pageBoundary.x;
float y = 0 - (pageBoundary.y - pageBoundary.height);
g.setColor(Color.WHITE);
g.fillRect((int) (0 - x),