// 2. Page rasterization.
int pageIndex = promptPageChoice("Select the page to render", pages.size());
Page page = pages.get(pageIndex);
Dimension2D imageSize = page.getSize();
Renderer renderer = new Renderer();
BufferedImage image = renderer.render(page, imageSize);
// 3. Save the page image!
try
{ImageIO.write(image,"jpg",new java.io.File(getOutputPath() + java.io.File.separator + "ContentRenderingSample.jpg"));}
catch(IOException e)