Friday, December 30, 2011

Ordered contents in iText (PDF generation)

We can use the List for adding the contents in our document.

So with the use of that List object we can easily manipulate the I/P data or data that are taken from any external resource.;
//Create a numbered List with 30-point field for the numbers.
List list=new List(true,30);
list.add(new ListItem("Ramt"));
list.add(new ListItem("Raj"));
list.add(new ListItem("Kamal"));
//Add a separator.
//Create a symboled List with a 30-point field for the symbols.
list=new List(false,30);
list.add (new ListItem ("Hello"));
list.add (new ListItem ("World"));
list.add (new ListItem ("Hai"));
list.add (new ListItem ("Kumar"));
// Add the list to the document.
doc.add (list);
doc.close ();

No comments:

Post a Comment