Share on Google+Share on Google+

Rajkumar
how to make list in our own style in pdfwriter
2 Answer(s)      6 years and 5 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?

Ads

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 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 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 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
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 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
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 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 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 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
Tutorials   
Java Spring Hibernate Struts Training Retrieve database from the table dynamically in jsp from oracle using servlet What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? neo4j-server.properties file location SASLError using PLAIN: not-authorized

Ads

 
Advertisement null

Ads