Core Java| JSP| Servlets| XML| EJB| JEE5| Web Services| J2ME| Glossary| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
Symbol Substitution 
 

In this example , we are going to explain how we can make symbols using iText api,s. We are using integer values which will converted it into symbol. For this we just convert the integer value into its character value.

 

Symbol Substitution     

                         

In this example , we are going to explain how we can make symbols using iText api,s. We are using integer values which will  converted it into symbol. For this we just convert the integer value into its character value.

Code Description:

In this example we  convents the integer values from 33 to 255 and 913 to 969 into character by using explicit casting  of integer values to character values. We use add(Phrase.getInstance(String s)) method to add the values into the document. 

The code of the program is given below:

import java.io.FileOutputStream;
import java.io.IOException;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Phrase;
import com.lowagie.text.pdf.PdfWriter;
import com.lowagie.text.Paragraph;
public class SymbolSubstitution {
  public static void main(String[] argsthrows Exception
               {
    System.out.println("Symbol Substitution");
    Document document = new Document();
      PdfWriter.getInstance(document,new
 FileOutputStream
("SymbolSubstitution.pdf"));
      document.open();
      document.add(new Paragraph("The values and its
 symboles are given below:"
));
      for (int i = 33; i < 255; i++) {
      document.add(Phrase.getInstance(" " + i + ": " (chari));
                 
      for (int i = 913; i < 969; i++) {
      document.add(Phrase.getInstance(" " + i + ": " (chari));
                    }
    document.close();
  }
}

The output of the program is given below:

Download this example.

 

                         

» View all related tutorials
Related Tags: c web pdf file stl text application import jar diff io make packages port this package itext app if tex

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Training Courses
Tell A Friend
Your Friend Name
Software Solutions
Least Viewed
Most Rated
Recently Viewed
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.