Example BarcodePDF417 : Barcode « PDF RTF « Java






Example BarcodePDF417

Example BarcodePDF417
import java.io.FileOutputStream;

import com.lowagie.text.Document;
import com.lowagie.text.Image;
import com.lowagie.text.PageSize;
import com.lowagie.text.pdf.BarcodePDF417;
import com.lowagie.text.pdf.PdfWriter;

public class ExampleBarcodePDF417 {
  public static void main(String[] args) {
        try {
            BarcodePDF417 pdf417 = new BarcodePDF417();
            pdf417.setText("www.java2s.com has some demo for PDF");
            Document document = new Document(PageSize.A4, 50, 50, 50, 50);
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("ExampleBarcodePDF417.pdf"));
            document.open();
            Image img = pdf417.getImage();
            img.scalePercent(50, 50 * pdf417.getYHeight());
            document.add(img);
            document.close();
        }
        catch (Exception e) {
            e.printStackTrace();
        }
  }
}

           
       








itext.zip( 1,748 k)

Related examples in the same category

1.Barcode 128
2.Barcodes 39Barcodes 39
3.Barcodes 39 ExtBarcodes 39 Ext
4.Barcodes 128 (2)Barcodes 128 (2)
5.BarcodesEAN 13BarcodesEAN 13
6.BarcodesEAN SUPPBarcodesEAN SUPP
7.BarcodesInter25BarcodesInter25
8.BarcodePostnetBarcodePostnet
9.BarcodesPostnet 2BarcodesPostnet 2
10.BarcodeEAN: SUPP5BarcodeEAN: SUPP5