Adding List to Paragraph : Paragraph « PDF RTF « Java






Adding List to Paragraph


import java.io.FileOutputStream;

import com.lowagie.text.Document;
import com.lowagie.text.List;
import com.lowagie.text.Paragraph;
import com.lowagie.text.html.HtmlWriter;
import com.lowagie.text.pdf.PdfWriter;

public class PDFListsAtoE {
  public static void main(String[] args) {
    Document document = new Document();
    try {
      PdfWriter.getInstance(document, new FileOutputStream("ListsAtoE.pdf"));
      document.open();

      Paragraph paragraph = new Paragraph("A to E:");
      List list = new List(false, 10);
      list.add("A");
      list.add("B");
      list.add("C");
      list.add("D");
      list.add("E");
      paragraph.add(list);
      document.add(paragraph);
    } catch (Exception ioe) {
      System.err.println(ioe.getMessage());
    }
    document.close();
  }
}
           
       








itext.zip( 1,748 k)

Related examples in the same category

1.Three ParagraphsThree Paragraphs
2.Adding Chunk and Phrase to ParagraphAdding Chunk and Phrase to Paragraph
3.Long Paragraph in PDFLong Paragraph in PDF
4.Generates a simple 'Hello World' PDF fileGenerates a simple 'Hello World' PDF file
5.Adding Paragraph to a PageAdding Paragraph to a Page
6.Adding Chunk to ParagraphAdding Chunk to Paragraph