Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners how to make list in our own style in pdfwriter
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Rajkumar
how to make list in our own style in pdfwriter
2 Answer(s)      4 years ago
Posted in : Java Beginners


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?


Advertisement
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 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 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 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 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 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 this pattern???
how to make this pattern???  how to make following pattern in javascript
How to make elements invisible ?
How to make elements invisible ?   How to make elements invisible
how make ID - Ajax
how make ID  how make a ID in eyeball chat
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 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 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 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 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 make bubbles, make bubbles, bubbles
How to make bubbles      ... to make it easily to draw. New File: First take colored background file. Draw... a little circle. Effect: Go to Layer menu > Layer style > Stroke, Gradient
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
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 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 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 transparent text
How to make a transparent text Learn how to make a transparent...) and make formatting as looking here. Write Text: Now write your text as you like. I have written here "Text". After writing text make copy (Ctr
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
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... to Layer menu > Layer style > Inner shadow, Bevel and Emboss, use same
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 identify the remote system that gets connected to our - Struts
How to identify the remote system that gets connected to our    Hi, I am doing a project which works on providing security.In this my pblem is any user from anywhere and any location if they get registered into our site how
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 run our application after deploying .war file in tomcat6.0
How to run our application after deploying .war file in tomcat6.0  I did all the things already, but I don't want this way. What I did, 1) first I... But I dont know how to run that application? Please tell me the way to run
How to run our application after deploying .war file in tomcat6.0
How to run our application after deploying .war file in tomcat6.0  How to run our application after deploying .war file in tomcat6.0?   Hi Friend, After installing the tomcat, follow these steps: 1)Go to the Control
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
Advertisements
 

 

 

DMCA.com