Tuesday, April 9, 2019
barcode
public class BarCode128 {
public static void main(String[] args) throws FileNotFoundException, DocumentException {
Document document = new Document(new Rectangle(PageSize.A4));
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("c:/Java4s_BarCode_128.pdf"));
document.open();
document.add(new Paragraph("Code_128 Format_Java4s.com"));
Barcode128 code128 = new Barcode128();
code128.setGenerateChecksum(true);
code128.setCode("1234554321");
document.add(code128.createImageWithBarcode(writer.getDirectContent(), null, null));
document.close();
System.out.println("Document Generated...!!!!!!");
}
}
Subscribe to:
Comments (Atom)