
can u please any of one help me i want to make a list as follows in pdf file from java by pdfwriter
account calculation
-------------------------
amount -100.00
advance - 70.00
-------------------------
net - 30.00
can u please help me?

Hi Friend,
Try the following code:
import java.io.*;
import com.lowagie.text.*;
import com.lowagie.text.pdf.*;
public class listDemo{
public static void main(String args[])throws Exception {
Document doc=new Document();
PdfWriter.getInstance(doc,new FileOutputStream("list.pdf"));
doc.open();
doc.add(new Paragraph("account calculation"));
doc.add(new Paragraph("--------------------------------------------------------"));
List list=new List(30);
list.add(new ListItem("amount -100.00"));
list.add(new ListItem("advance - 70.00"));
doc.add(list);
doc.add(Chunk.NEWLINE);
doc.add(new Paragraph("---------------------------------------------------------"));
list=new List(30);
list.add (new ListItem ("net -30"));
doc.add (list);
doc.close ();
}
}
To run the above code, you need iText-2.1.5.jar file.
Thanks

thank u
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.