I'm using iText to create a PDF417 bar code like so:
private InputStream getBarcode() throws Exception {
BarcodePDF417 barcode = new BarcodePDF417();
barcode.setText("Sample bar code text");
Image image = barcode.getImage();
image.scalePercent(50, 50 * barcode.getYHeight());
return new ByteArrayInputStream(image.getRawData());
}
I need to convert the CCITT format returned by barcode.getImage()
to either JPG, GIF, or PNG so I can include it in a document I'm creating in JasperReports.