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



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

Have Programming Question? Ask it here!
 
 
 


Rajkumar
how to make list in our own style in pdfwriter
2 Answer(s)      3 years and 8 months 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 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 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 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 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 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 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 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 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
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 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
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 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
how to make a label left alignment?
how to make a label left alignment?  how to make a label left alignment
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 paging with class and ajax
how to make paging with class and ajax  paging with class and ajax
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
Local style sheets in Flex4
Local style sheets in Flex4: You can set the style of components in <fx:Style> tag. You can make a class and set the properties in it. The syntax...; selector_name { style_property: value; [...] } </fx:Style>
How to make a diamond necklace, make a diamond necklace, diamond necklace
How to make a diamond necklace     ... menu > Layer style > Bevel and Emboss, Outer glow and make same settings. You will get it. Now with same layer style draw a circle. Make many
How to Make iPhone Window Application
How to Make iPhone Window Application  Hi, For Making iphone window application, what parameters i have to follow or provide example related to iphone window application. Thanks
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. Selection: Make selection by the Polygonal lasso tool (L
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... like.   Layer style: Go to Layer menu > Layer style > Apply Bevel
How to make query and abstraction in Java
How to make query and abstraction in Java  Hi, I read the lessons you have in the sites. They are really useful. However, I could not write codes... PostgreSQL database, and I want to make a query and abstraction for a table. Could
Flex Style Property
a way to use Style for flex component. You can see how to use local style in flex. User can implement Style property in own application by using <mx:Style>...Style in Flex:- Style is the main part of the Flex because user can change
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. Text Formatting: Choose Horizontal type tool (T key) and make formatting then write
Style in button
Style in button  Hi.... How can I set the button width with fx:style... of the button will not set by the style because it is the property of the button not the style property of the button. Thanks
How to make a button of different behaviour?
How to make a button of different behaviour?  Suppose In a jsp page I have a button SAVE with id="btnSave" value="SAVE" and a javascript function... ajaxInsertUpdateData(document.getElementByID("btnSave1").value,......); How to do
Style in AdvancedDataGrid
Style in AdvancedDataGrid control: We use a inline style for AdvancedDataGrid. In this example you can see how we can use a style in AdvanceddataGrid... title="Style in AdvancedDataGrid Control Example" height="470
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. Effects: Go to Layer menu > Layer style > Drop shadow, Inner glow, Bevel and emboss
How To Make This Program - Java Beginners
How To Make This Program  How To Make Java Calculation program I want to Write a program in Java that calculates the sum of digits of an input number, prints it, then calculates the sum... output: 59 14 5 please help to make
how to make employee i card
how to make employee i card  hello friends can anyone help me.. I have to make a project to make Identity card for employees...but i am facing problems with database and jsp connection ... also tell me how to retrive data
how to update checkbox list in database
how to update checkbox list in database  Issues: i am using different checkboxs for getting role then all role list store in one string array i want to update one by one but it's not updating by using below code .it's not adding
Advertisements
 

 

 

DMCA.com