public void readAll() throws IOException, DocumentException {
cb.saveState();
java.awt.Graphics2D g2 = cb.createGraphicsShapes(PageSize.A4.
width(), PageSize.A4.height());
try {
PAContext context = new PAContext( (Graphics2D) g2,
new Dimension( (int) PageSize.A4.width(),
(int) PageSize.A4.height()));
context.draw(new BufferedInputStream(in));
// ( (Graphics2D) backBuffer.getGraphics()).dispose();
in.close();
}
catch (IOException ex) {
ex.printStackTrace();
}
catch (PainterException ex) {
ex.printStackTrace();
}
cb.restoreState();
}
|