how to make list in our own style in pdfwriter

how to make list in our own style in pdfwriter

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?

View Answers

November 27, 2010 at 5:51 PM

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


November 30, 2010 at 12:29 PM

thank u









Related Tutorials/Questions & Answers:
how to make list in our own style in pdfwriter
how to make list in our own style in pdfwriter  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
How to put our own wanted thread into running state..?
How to put our own wanted thread into running state..?  How to put our own wanted thread into the running state by stopping already running one
Advertisements
we can create our own header file in java?n how to create?
we can create our own header file in java?n how to create?  we can create our own header file in java?n how to create
How to make a new List in Java
How to make a new List in Java  Hi, I have to create list object in Java. How to make a new List in Java? Thanks (adsbygoogle... the new operator as shown below: List list = new ArrayList(); Thanks
How to make a list from file text in J2ME - Java Beginners
How to make a list from file text in J2ME  I was trying to make a method that read file from text and make a list of it, I have tried ReadHelpText method and want to make some improvement, I've tried like this private String
How do I make an n list size in Python
How do I make an n list size in Python  Hi, I am working on a project where I have to make array of pre-defined size and fill it with zero. How do I make an n list size in Python? Thanks   Hi, I Python you can do
How do I change the while loop in this code to the range with range list style display page for a resultSet() in jsp?
How do I change the while loop in this code to the range with range list style display page for a resultSet() in jsp?  this is count record code <%@ page language="java" import="java.sql.*" %> <html> <head>
how to make drop down list in JSF & fetch data Item from database
how to make drop down list in JSF & fetch data Item from database  how to make drop down list in JSF & fetch data Item from database
How to learn data science by own?
Learning Data Science - How to learn data science by own? In this post we will tell you how you can learn data science by own and master the topics.... The question "How to learn data science by own?" is certainly
how make ID - Ajax
how make ID  how make a ID in eyeball chat
How to make elements invisible ?
How to make elements invisible ?   How to make elements invisible
how to make this pattern???
how to make this pattern???  how to make following pattern in javascript
How to create own help forum - JSP-Servlet
How to create own help forum  Hi All, My client given requirements, they need to create their own help forum, I need to do case study for, how to create any forum. if you have any documentation or technical ideas please
how to make multiple choice questions
how to make multiple choice questions  I have to make a multiple... and answers. how to associate group of questions to a user? so each user will have his own set of questions and answers
How to make a chain, make a chain, chain
How to make a chain       To learn how to design a chain in the photoshop has become so easy by this example, it has some important instruction to make it so follow
how to make exampage in jsp ?
how to make exampage in jsp ?  how to make a online exam page in jsp and servelet
How to make bubbles, make bubbles, bubbles
How to make bubbles      ... to make it easily to draw. New File: First take colored background file.ADS...; Layer style > Stroke, Gradient Overlay, use same both settings as given below
How to make a transparent text
How to make a transparent text Learn how to make a transparent... mask tool (T key) and make formatting as looking here. Write Text: Now write... text make copy (Ctr +C) and past (Ctr + V).ADS_TO_REPLACE_2 Drop Shadow: Go
how to create own tld and use it in jspx file
how to create own tld and use it in jspx file  I wanted to add fmt as own tag and internationalize add.title=Add. please help me solve the problem. <!-- Document : add Created on : Mar 4, 2012, 7:00:38 PM
how to create own tld and use it in jspx file
how to create own tld and use it in jspx file  I wanted to add fmt as own tag and internationalize add.title=Add. please help me solve the problem. <!-- Document : add Created on : Mar 4, 2012, 7:00:38 PM
how to make a program on array
how to make a program on array  When you make a program on array that the element will move downward and upward and when you input twice 0 then thats the time that it will not move. pls. give me a formula...tnx
How to make a bone, make a bone, a bone
How to make a bone       This example bone design example, It is very easy. If you are looking... as here.ADS_TO_REPLACE_2 Effects: Go to Layer menu > Layer style > Inner
How to make selectOneMenu scrollable
How to make selectOneMenu scrollable  how to make the selectOneMenu scrollable? I have around 20 values in drop down and i want the scrollable functionality after 5 values. Kindly reply as soon as possible. Thanks Shikha
How to make halo effect
How to make halo effect       Now get ready to learn a simple way to make a halo effect on the picture, follow to make it. Take a picture: Capture any picture to give
Inline style in Flex4
Inline style in Flex4: When you can set the properties of components in its own tag called a inline style sheet. In this example you can see how we can use a inline style sheet in our application. Example: <?xml
how to make multiple rectangles
how to make multiple rectangles  I,m a beginner , m sorry... of the array list in rectangles. as in each element should be in different rectangles...(JFrame.EXIT_ON_CLOSE); //Set JFrame size setSize(400,400); //Make JFrame
How to Create Jar File using Java
How to Create Jar File using Java Programming Language A Jar file combines several classes into a single archive file. Basically,library classes are stored in the jar file.  In this section, we are going to create our own jar file
How to make a diamond necklace, make a diamond necklace, diamond necklace
How to make a diamond necklace       This tutorial will give you instruction to make draw a diamond... with same layer style draw a circle.ADS_TO_REPLACE_4 Make many circle shape
how make excel
how make excel  how make excel spreadsheet IN JAVA. please send this code argently   Hello Friend, Try the following code: import java.io.*; import org.apache.poi.hssf.usermodel.HSSFSheet; import
How to create a databas locally in our system using Oracle 10g????
How to create a databas locally in our system using Oracle 10g????  How to create a databas locally in our system using Oracle 10g
How to make frame of the picture, make frame of the picture, frame of the picture
How to make frame of the picture   ..., I have mention here all the steps to make this effect. Take picture: First take a picture to framed.ADS_TO_REPLACE_1 Selection: Make selection
how to make paging with function ?
how to make paging with function ?  how to make paging with function ?   //this page is display.php <?php</p> $con=mysql_connect("localhost","root",""); if(!$con) { die("you can connect please check". mysql
how to make a field left justification
how to make a field left justification  how to make a field left justification.need code.thanks in advance
how to make a label left alignment?
how to make a label left alignment?  how to make a label left alignment
How to make first JSP page?
How to make first JSP page?  Hello, How I can make first JSP page? Thanks
How to make a home icon, make a home icon, home icon
How to make a home icon       This example is very useful to make a home icon, it is used... with any color as you like.   Layer style: Go to Layer menu > Layer style
How to make a 3D text, make a 3D text, a 3D text
How to make a 3D text      ... will guide you to make it. New File: Take a new file with any size as you like.ADS_TO_REPLACE_1 Text Formatting: Choose Horizontal type tool (T key) and make
How to make a loading symbol
How to make a loading symbol Learn here to create your own loading...; Layer Style > Inner Shadow, Bevel and Emboss and use both settings. ADS_TO_REPLACE_2 Write text: Take a Horizontal type tool (T key) and make
how to make paging with class and ajax
how to make paging with class and ajax  paging with class and ajax
Writing SEO Articles for Own Website,How to Write Effective SEO Articles for Own Website
Writing SEO Articles for Own Website Writing SEO articles for our own website requires a lot of commitment and hard work on our part. The article written by us must be capable in selling our services and publicizing our
How to make directory in java
Description: This example demonstrate how to create a directory at specified path. Code: import java.io.File; public ... is that it will make a dir at root directory of C drive
Version of com.clover>common-style dependency
List of Version of com.clover>common-style dependency
Version of com.kohlschutter>coding-style dependency
List of Version of com.kohlschutter>coding-style dependency
How to make a gel text, make a gel text, a gel text
How to make a gel text      ... to make. New File: Take a new file with any size as you want.ADS_TO_REPLACE_1 Effects: Go to Layer menu > Layer style > Drop shadow, Inner glow, Bevel
creating own ArrayList without Collections?
creating own ArrayList without Collections?  How can we write our own arraylist without using collections in JAVA
How to make a cracked wall effect, make a cracked wall effect, cracked wall effect
How to make a cracked wall effect     ... effect without any doubt, follow some steps to make this effect. Take a picture: Start this example with a wall picture.ADS_TO_REPLACE_1 Selection: Make
How to make a honey text, make a honey text, honey text
How to make a honey text      ..._TO_REPLACE_2 Effects: Go to Layer Menu > Layer Style > Bevel and Emboss...) and make formatting to write text in the document as I have done here
How to make an animation in the text, make an animation in the text, an animation in the text
How to make an animation in the text   ..., in this example we are going to make animation in the text that is so easy... tool (T key) then make formatting to write text.ADS_TO_REPLACE_1 Effect: Go
How to make first JSP page?
How to make first JSP page?  Hello, How I can make first JSP page? Thanks   HI, Beginner can learn JSP from writing the first Program... tutorial: How to make my first JSP page? Thanks
How to make a dropping text, make a dropping text, dropping text
How to make a dripping text     ...) and make formatting to write text as given here.  Brush effect: Take a new layer and choose Brush tool (B key) then make settings

Ads