cb.concatCTM(1.0f, 0, 0, 1.0f, 36, 0);
float width = document.getPageSize().getWidth() - 20;
float height = document.getPageSize().getHeight() - 20;
Graphics2D g2 = cb.createGraphics(width, height);
//g2.rotate(Math.toRadians(-90), 100, 100);
PrintTranscoder prm = new PrintTranscoder();
TranscoderInput ti = new TranscoderInput(new StringReader(t));
prm.transcode(ti, null);
PageFormat pg = new PageFormat();
Paper pp = new Paper();
pp.setSize(width, height);
pp.setImageableArea(5, 5, width, height);
pg.setPaper(pp);
prm.print(g2, pg, 0);
g2.dispose();
cb.restoreState();
}
document.close();