Example usage for com.itextpdf.text Image getRawData

List of usage examples for com.itextpdf.text Image getRawData

Introduction

In this page you can find the example usage for com.itextpdf.text Image getRawData.

Prototype

public byte[] getRawData() 

Source Link

Document

Gets the raw data for the image.

Usage

From source file:com.divudi.bean.BarcodeController.java

public byte[] getBarcodeBytes(String code) {
    Barcode39 code39 = new Barcode39();
    code39.setCode(code);//w  ww .jav  a  2  s  . c o  m
    code39.setFont(null);
    code39.setExtended(true);
    Image image = null;
    try {
        image = Image.getInstance(code39.createAwtImage(Color.BLACK, Color.WHITE), null);
    } catch (BadElementException | IOException ex) {
        Logger.getLogger(BarcodeController.class.getName()).log(Level.SEVERE, null, ex);
    }
    return image.getRawData();
}