public void generatePSusingJava2D(File outputFile) throws IOException {
OutputStream out = new java.io.FileOutputStream(outputFile);
out = new java.io.BufferedOutputStream(out);
try {
//Instantiate the PSDocumentGraphics2D instance
PSDocumentGraphics2D g2d = new PSDocumentGraphics2D(false);
g2d.setGraphicContext(new org.apache.xmlgraphics.java2d.GraphicContext());
//Set up the document size
g2d.setupDocument(out, 400, 200); //400pt x 200pt
paintTileAlone(g2d);
paintShapes(g2d);
paintText(g2d);
g2d.nextPage();
paintText(g2d);
//Cleanup
g2d.finish();
} finally {
IOUtils.closeQuietly(out);
}
}