Adding list to Pdf document : List « PDF RTF « Java






Adding list to Pdf document

Adding list to Pdf document

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;

public class HTMLListsAtoEPDF {
  public static void main(String[] args) {
    Document document = new Document();
    try {
      HtmlWriter.getInstance(document, new FileOutputStream("HTMLListsAtoEPDF.html"));
      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.List and Sublist in HTMLList and Sublist in HTML
2.List and Sublist in PDFList and Sublist in PDF
3.Lists With Different FontsLists With Different Fonts
4.Lists with Different Font PDF and HTML
5.Changing List symbol for HTML documentChanging List symbol for HTML document
6.List Symbol IllustrationList Symbol Illustration
7.List With Long Text Line in HTMLList With Long Text Line in HTML
8.List With Long Text Line in PDFList With Long Text Line in PDF