How to Create Roman List In pdf in java


In this core java tutorial we will learn Create Roman List In pdf in java using iText library - core java tutorial with program and examples.

First create RomanList (com.itextpdf.text.RomanList) and then add ListItems (com.itextpdf.text.ListItem) in RomanList using add method of RomanList (romanList.add(new ListItem("Item 1"))).


Create ZapfDingbats List In pdf in java - iText java tutorial program

How to Create Ordered List In pdf in java using iText - iText java tutorial

Creating the UnOrdered List In pdf in java - iText java tutorial example

How to Create Lists And SubLists In Pdf in java - iText java tutorial




Download jars required to execute program >

Or, you may download jars from here.

Program/Example how to Create Roman List In pdf in java  - Using iText library - core java tutorial

import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
import com.itextpdf.text.Document;
import com.itextpdf.text.ListItem;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.RomanList;
import com.itextpdf.text.pdf.PdfWriter;
/**
*
*  How to Create Roman List In Pdf Example -
*  Using iText library - core java tutorial
*
*/
public class CreateRomanListInPdfExample {
   public static void main(String[] args) {
          try {
                 String pdfFilePath = "E:/Create Roman List In Pdf Example.pdf";
                 OutputStream fos = new FileOutputStream(new File(pdfFilePath));
                 Document document = new Document();
                 PdfWriter.getInstance(document, fos);
                 document.open();
                 document.add(new Paragraph("This is RomanList"));
                 // Create ROMAN list - in PDF using iText library in java
                 RomanList romanList = new RomanList();
                 // Add items in ROMAN list - in PDF using iText library in java
                 romanList.add(new ListItem("Item 1"));
                 romanList.add(new ListItem("Item 2"));
                 romanList.add(new ListItem("Item 3"));
                 romanList.add(new ListItem("Item 4"));
                 romanList.add(new ListItem("Item 5"));
                 romanList.add(new ListItem("Item 6"));
                 romanList.add(new ListItem("Item 7"));
                 romanList.add(new ListItem("Item 8"));
                 romanList.add(new ListItem("Item 9"));
                 romanList.add(new ListItem("Item 10"));
                 document.add(romanList);
                 document.close();
                 fos.close();
                 System.out.println("PDF created in >> " + pdfFilePath);
          } catch (Exception e) {
                 e.printStackTrace();
          }
   }
}
/* OUTPUT of above program/Example -
PDF created in >> E:/Create Roman List In Pdf Example.pdf
*/


PDF formed after executing above java program(How to Create Roman List In pdf in java) will look like this >


Summary -
So in this core java tutorial we Created Roman List In pdf in java using iText library - core java tutorial with program and examples.
We first created RomanList (com.itextpdf.text.RomanList) and then added ListItems (com.itextpdf.text.ListItem) in RomanList using add method of RomanList (romanList.add(new ListItem("Item 1"))).



Having any doubt? or you you liked the tutorial! Please comment in below section.
Please express your love by liking JavaMadeSoEasy.com (JMSE) on facebook, following on google+ or Twitter.

References >



RELATED LINKS>

iText library tutorial in java - How to Create and work with PDF files in java

HTML to PDF in java - iText tutorial >

Convert Html To Pdf in java using iText - iText java tutorial


Create new page, set page height and width in java - iText tutorial >

How To Create New Pages In Pdf Using Itext - iText java tutorial example

How to Find Pdf Page Height And Width in java - iText java tutorial program



HEADER and FOOTER in pdf in java - iText tutorial >

How To Set Header and Footer in pdf in java using Itext Example - iText java tutorial



BAR AND PIE CHARTS in pdf in java - iText tutorial >

How to create Bar Chart In Pdf in java - iText java tutorial

Create Pie Chart In Pdf in java using itext - iText java tutorial



MODIFY/ EDIT pdf in java - iText tutorial >

How to Modify - Add Text To Existing PDF in java - iText java tutorial example

How To Read And Add Image To Existing Pdf in java Example - iText java tutorial






No comments:

Post a Comment