Sunday, January 30, 2011

Java : Converting Input Text into .PDF File


Here we are discussing the convertion of a text file into a pdf file by using an example. In this example we take a string  from console, pass this string into an object of paragraph class. Pass this paragraph object into the add() method of the document class to generate a pdf file. Download iText API required for the conversion of a text file into the pdf filefromhttp://www.lowagie.com/iText/download.html.
First set the class path for jar file by using the following steps:
1.Download the iText jar files.
2.Unzip all  the .jar files.
3.Copy all .jar files into lib directory of jdk. e.g. For jdk1.6.0 we need to copy  C:\jdk1.6.0\lib.
4.To set the classpath follow these steps.
Right click on " My Computer->Click on Properties->Advanced->Environment variables 
In the Environment variable check whether the classpath is set or not in the variable "classpath". If the path is not set then click on "Edit" button (if variable classpath is already created otherwise create the variable "classpath") and set the full path with the name of iText API .jar files then click on OK button and finally on Apply button.
Use InputStream for reading the text from console that returns a string into byte format. Convert this byte formatted string into string by using BufferedReader. Follow the steps given below to generate a pdf file.

1.Create an instance of the Document class. The Document class describes a document's page size , margins, and other important attributes. The Document class act as a container for a document's sections, images, paragraphs, chapters and other contents.
2.Use PdfWriter.getInstance (doc, new FileOutputStream ("pdfFile.pdf")) for creating a PDF document writer.
3. Open the document by using doc.open ().
4. Add content to the document. Use Paragraph p = new Paragraph (String str) to create a Paragraph that is used to store the string.
6.Use doc.add(p) to add the text.
5. Close the document by using doc.close ().


Here is the code of the program :
import java.io.*;
import java.awt.*;
import com.lowagie.text.*;
import com.lowagie.text.pdf.*;
import java.io.*;
import java.util.zip.*;

public class TextToPDF{
  public static void main(String arg[]){
    try{
      InputStreamReader in= new InputStreamReader(System.in);
      BufferedReader bin= new BufferedReader(in);
      System.out.println("Enter text:");
        String text=bin.readLine();
        Document document = new Document(PageSize.A4, 3672108180);
        PdfWriter.getInstance(document,new FileOutputStream("pdfFile.pdf"));
        document.open();
        document.add(new Paragraph(text));
        System.out.println("Text is inserted into pdf file");
        document.close();
    }catch(Exception e){}
  }
}

Friday, January 21, 2011

Such a nice thing

After so long time i saw  in Tv9 which is useful to the society .... Regarding , huge response, to Ex. MLA and Mininster Shri Nagireddy from the people of the great andhra,

Saturday, January 15, 2011

my Views on Films

Basically i pay much attention and interest to see "making of a film" episodes rather than film itself.  Because  my mind always gives me that kind of instructions to me..  Recently i saw the making of "Troy" it's very interesting...

Friday, January 7, 2011

Post your suggestions and comments

Tell your opinions on my postings 'pros and cons'

Wednesday, December 22, 2010

Work with Home PC when u r in Office

This is the query i used to ask so many professional ... Finally i got the answer ... !! Yes, it's possible to transfer your home PC control to at your office desk... Just by using Team Viewer ... 
The basic requirements i found :

  • Both parties should have internet connection
  • Both parties should be installed Team Viewer Software at the PC's
Ya... I't enough ... 

Tuesday, December 21, 2010

My National Conference paper on DDBS

Performance Improvement in Optimistic Concurrency Control Mechanism of Distributed Databases

The main aim of the paper is to improve the performance of optimistic concurrency control mechanism in distributed databases.  The original approach of optimistic concurrency with respect to the validation technique, the treatment of long transactions and the problem of starvation.   In this paper, design alternatives of the validation phase are considered which not only avoid these disadvantages but additionally improve the performance of the original approach. Very promising is a new validation technique which especially supports read-transactions, therefore, decreasing the number of backups substantially. An adaptation of the new optimistic concurrency control schemes to a distributed environment is presented. The proposed algorithm is deadlock free and offers high parallelism.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
This is my paper which is selected in National Conference held at Kongu Engg. College, Erode

Monday, December 20, 2010

The Base of Hindu

Sakamulu(2) 
Saalivaahana Sakamu
Vikramaarka Sakamu.
Kaalamulu (3 Seasons) 
Vaesavi Kaalamu (Summer)
Varshaa Kaalamu or Vaanaa Kalamu (Rainy Season)
Seetha Kaalamu or Chali Kaalamu (Winter)
Trimoorthulu(3) 
Brahma (Creator)
Vishnu (Protector)
Maheswarudu/Rudhrudu (Destroyer). 
Triloakamulu(3) 
Swargamu
Marthyaloakamu
Paathaalamu. 
Trikaalamulu(3)
Bhoothamu (Past)
Bhavishyaththu (Future)
Varthamaanamu (Present).
Trikaranamulu(3) 
Manasa (Manassu)
Vaacha (Vaakku)
Karmana (Pani).
Trigunamulu(3) 
Satva
Rajo
Tamo.
Trimataacharyulu(3) 
Sankara
Raamaanuja
Madhva.


Origin of Telugu Literature :
I am not sure of the origin of telugu language. But all of our south indian languages are derived from a common language called "DRAVIDA", but luckily telugu is the sweetest language out of them. That way people say it "italian of the east"( ref: sir C.P.Brown).Telugu literature was started in 11th century by the great person named " NANNAYYA". He was the first person who gave life to our telugu literature first time. He put his efforts to write " maha bharatam" in telugu. Before that there is no single telugu literature. So we can say telugu literature stated in 11th century.

Purushaardhamulu(4) 
Dharma
Ardha
Kaama
Moaksha.
Chaturvaedamulu(4) 
Rug
Yajur
Saama
Adharvana.
Vayoavasthalu(4) 
Baalyamu (Childhood)
Yavvanamu (Teenage)
Kaumaaramu (Middle age)
Vaarthakyamu (Old age).
Chaturaasramamulu(4) 
Brahmacharyamu
Gaarhastyamu(Gruhasthamu)
Vaanaprasthamu
Sanyaasamu.
Panchabhoothamulu(5) 
Bhoomi (Earth)
Neeru (Water)
Taejassu (Light)
Vaayuvu (Air)
Aakaasamu (Sky). 
Yugamulu(4) 
Kruta Yugamu (17,28,000 years)
Traetaa Yugamu (12,96,000 years)
Dwaapara Yugamu (8,64,000 years)
Kali Yugamu (4,32,000 years)
Panchakaavyamulu(5) 
Raghuvamsamu
Kumaara Sambhavamu
Maegha Sandaesamu
Bhaaravi
Maaghamu.
Pancha Gangalu (5 rivers) 
Ganga
Krishna
Godavari
Tungabhadra
Kaveri.
Panchaamrutamulu(5) 
Neeru (Water)
Paalu (Milk)
Perugu (Curd)
Neyyi (Ghee)
Thaene (Honey).
Panchaangamulu(5) 
Thidhi
Vaaramu
Nakshathramu
Yogamu
Karanamu
Rutuvulu (6 Seasons) 
Vasantha
Greeshma
Varsha
Haemantha
Sarath
Sisira.
Shadrasamulu (6 tastes) 
Uppu
Pulupu
Kaaramu
Theepi
Chaedu
Vagaru.
Shadchakravartulu (6 kings) 
Harischandhrudu
Naludu
Purukutsudu
Purooravudu
Sagarudu
Kaarta Veeryaarjunudu.
Vaaramulu (7-Days of the week) 
Aadhi Vaaramu = Sunday
Soma Vaaramu = Monday ('So'as in Soldier)
Mangala Vaaramu = Tuesday
Budha Vaaramu = Wednesday
Guru Vaaramu = Thursday
Sukra Vaaramu = Friday
Seni Vaaramu = Saturday ('Se' as in set)
Sapta Mahaa Rushulu
(7 Great Saints)
 
Kasyapudu
Atri
Bharadwaajudu
Viswaamitrudu
Gouthamudu
Vasishtudu
Jamadagni.
Sapta Samudramulu
(7 Seas)
 
Lavana Samudramu
Ikshu Samudramu
Sura Samudramu
Sarpi Samudramu
Dadhi Samudramu
Ksheera Samudramu
Jala Samudramu
Sapta Loakamulu
(7 Upper Worlds)
 
Bhoolokamu
Bhuvarlokamu
Suvarlokamu
Maharlokamu
Janarlokamu
Tapolokamu
Satyalokamu

(7 Lower Worlds)
 
Atalamu
Vitalamu
Sutalamu
Talaatalamu
Mahaatalamu
Rasaatalamu
Paataalamu.
Ashtaavadhaanamulu
(8 Skills)
 
Chaturangamu (Chess)
Kavitvamu (Poetry)
Vraayuta (Writing)
Chaduvuta (Reading)
Ganitamu (Mathematics)
Sangeetamu (Music)
Yukti Chepputa (Questioning)
Vyasthaakshari.
Dhikkulu
(8-Directions)
 
1.Thoorpu = East
2.Padamara = West
3.Uttharamu = North
4.Dakshinamu = South
5.Aagnaeyamu = South-East
6.Nairuthi = South-West
7.Vaayuvyamu = North-West
8.Eesanyamu = North-East ('Sa' as in Sat)
Ashta Dikpaalakulu (8) 
Indhrudu
Agni
Yamudu
Nibuthi
Varunudu
Vaayuvu
Kubaerudu
Eesanudu
Ashta Lakshmulu (8) 
Dhana Lakshmi
Dhaanya Lakshmi
Vijaya Lakshmi / Jaya Lakshmi
Dhairya Lakshmi
Santhaana Lakshmi
Gaja Lakshmi
Aadhi Lakshmi
Vidyaa Lakshmi
Astanga Yoga (8 Limbs) 
Asanas
Yamas (Restraints)
Niyamas (Observances)
Pranayama (Breathing)
Pratyahara (Withdrawal of senses)
Dharana (Concentration)
Dhyana (Meditation),&
Samadhi. 

Nava Brahmalu (9 Creators) 
Mareechi
Bharadwajudu
Angeerasudu
Pulasthyudu
Pulahudu
Kratuvu
Dakshudu
Vasishstudu
Vaasudevudu.
Nava Rasamulu (9 Poses) 
Srungaaramu (Romance)
Haasyamu (Humour)
Karunamu (Kindness, Pity)
Roudramu (Anger)
Veeramu (Heroism)
Bhayaanakamu (Threatening)
Bheebhatsamu (Destruction)
Adhbhutamu (Wonder)
Saantamu (Peace)
(Saan as in sandwitch).
Nava Dweepaalu
(9 Islands)
 
Indhra dweepam.
Swaetha dweepam.
Thaamravarni dweepam.
Gabhasthi dweepam.
Naagara dweepam.
Soumya dweepam.
Gaandharva dweepam.
Vaarunaa dweepam.
Jamboo dweepam.
Nava Ratnamulu
(9 Precious Stones)
 
Vajramu
Vaidooryamu
Gomedhikamu
Pushya Raagamu
Marakathamu
Maanikyamu
Neelamu
Pravaalamu
Mutyamu.
Nava Dhaanyamulu (9 grains) 
Vadlu      Minumulu      Anumulu
Ulavalu    Nuvvulu        Kandulu
Pesalu     Godhumalu    Senagalu.
Telugu Raasulu
(12 Zodiac Signs)
 
Maeshamu - Maeka - Aries.
Vrushabhamu - Yeddhu - Taurus.
Mithunamu - Dampathulu - Gemini.
Karkaatakamu - Endrakaaya - Cancer.
Simhamu - Singamu - Leo.
Kanya - Paduchu - Virgo.
Tula - Traasu - Libra.
Vruchchikamu - Thaelu - Scorpio.
Dhanussu - Villu - Sagittarius.
Makaramu - Mosali - Capricorn.
Kumbhamu - Kadava - Aquarius.
Meenamu - Chaepa - Pisces.
Nelalu
(12-Months)
 
Chaitramu = March-April
Vaisaakhamu = April-May
Jyaestamu = May-June
Aashaadamu = June-July
Sraavanamu = July-August
Bhaadrapadamu = August-September
Aaswayujamu = September-October
Kaartheekamu = October-November
Maargasiramu = November-December
Pushyamu = December-January
Maaghamu = January-February
Phaalgunamu = February-March.
Astaadasa Puraanaalu (18) 
Matsya Puraanam.
Maarkaandaeya Puraanam.
Bhaagavata Puraanam.
Bhavishyaththu Puraanam.
Bramhaanda Puraanam.
Bramha Vaivartha Puraanam.
Bramha Puraanam.
Vaamana Puraanam.
Vaayu Puraanam.
Vishnu Puraanam.
Varaaha Puraanam.
Agni Puraanam.
Naarada Puraanam.
Padma Puraanam.
Linga Puraanam.
Garuda Puraanam.
Koorma Puraanam.
Scaanda Puraanam.
Telugu Mahaa Kavulu (18 Great poets) 
Nannaya Bhattu.
Tikkana Somayaaji.
Errapraggada.
Paalkuriki Somana.
Vemulavaada Bheemakavi.
Bhaskarudu.
Ranganathudu.
Srinadhudu.
Bammera Pothana.
Vemana.
Tallapaka Annamacharyudu.
Sri Krishna Deva Rayalu.
Ashta Diggaja Kavulu 
   (i)     Allasaani Peddana
   (ii)    Nandi Timmana
   (iii)   Maadayagari Mallana
   (iv)   Dhoorjati
   (v)    Ayyala Raaju Raama Bhadrudu
   (vi)   Pingali Soorana
   (vii)  Ramarajabhushana and
   (viii) Tenali Rama Krishna.
Molla.
Tarigonda Venkamma.
Thyagaraju.
Chinnaya Soori.
Kandukuri Veeresalingam Pantulu