Thursday, November 18, 2010

Covert doc, excel, text and images to PDF

To convert the text, images and html we can use iText api but that cannot be lonely use to convert the word and excel files into PDF. with the combination of apache poi and iText can covert the word and excel files into PDF format.

downlaod iText from http://itextpdf.com/
downlaod apache poi from http://poi.apache.org/download.html

package pdf;
import com.itextpdf.text.Document;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.PdfWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileInputStream;
import org.apache.poi.hwpf.HWPFDocument;
import org.apache.poi.hwpf.extractor.WordExtractor;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.extractor.ExcelExtractor;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.poifs.filesystem.*;

public class pdfconvert {

public static void main(String args[]){

pdfconvert pdfConversion = new pdfconvert();

// arguments are differnt for the situation
pdfConversion.createPdf("E:/L4_project/sample/images.jpg","E:/L4_project/sample/images.pdf", "image");

}

// generate the pdf file according to the input file format
// inputFile - input file path
// outputFile - output file path
// type - type of the file
private void createPdf(String inputFile, String outputFile, String type){

Document pdfdoc=new Document();
String pdfFilePath = outputFile;
WordExtractor Wextractor = null ; // word documents
ExcelExtractor Eextractor = null ; // excel documents

try{
FileOutputStream fileOutputStream = new FileOutputStream(pdfFilePath);
PdfWriter writer = null;
writer = PdfWriter.getInstance(pdfdoc, fileOutputStream);
writer.open();
pdfdoc.open();


System.out.println("Creating pdf document.....");
if (type.equals("image")){

pdfdoc.add(com.itextpdf.text.Image.getInstance(inputFile));

} else if (type.equals("text")){

File file = new File(inputFile);
pdfdoc.add(new Paragraph(org.apache.commons.io.FileUtils.readFileToString(file)));

} else if(type.equals("word")){

File file = new File(inputFile);
POIFSFileSystem fis=new POIFSFileSystem(new FileInputStream(file)) ;
HWPFDocument document=new HWPFDocument(fis);
Wextractor = new WordExtractor(document);
String [] fileData = Wextractor.getParagraphText();
String st="";

for(int i=0;i
if(fileData[i] != null)
st+=fileData[i]+" ";
}
pdfdoc.add(new Paragraph(st));

} else if(type.equals("excel")){

File file = new File(inputFile);
POIFSFileSystem fis=new POIFSFileSystem(new FileInputStream(file)) ;
HSSFWorkbook book = new HSSFWorkbook(fis);
Eextractor = new ExcelExtractor(book);
String filedata = Eextractor.getText();
pdfdoc.add(new Paragraph(filedata));

}
System.out.println("finish...");
pdfdoc.close();
writer.close();
}catch(Exception exception){
exception.printStackTrace();
System.out.println("Document Exception!" + exception);

}
}

}

Converting Digital Objects into It's Archival File Format

Converting Digital Objects into It's Archival File Format

From today I am going to post the details of my final year project. The project is converting digital objects into it`s archival format and this is project of the Department of National Archives of Sri Lanaka.

with the technology development today most of the organizations using digital documents rather than paper based documents. But as we all know that digital documents are fragile with compared to paper documents. The documents that generated by the organization is evidences for the organization activities and decisions of the relevant authorities. so it is obvious that digital documents are also need to archive or preserve interm of future usage.

when we going to archive digital documents first need to consider the file format that is use for the archive. because the readability of the document is depend on the archival file format so that format should be able to use after 20 or 50 years later.

It is obvious that all the digital objects cannot have same archival format. because if take word file and video file they have different features and characteristics.

But word, excel, power point, text and image can have one archival format which is PDF format.

I mainly use java to develop the project.

Social Bookmarking sites

The following I have listed the 174 social book marking sites.
http://blinklist.com/
http://www.blurpalicious.com/
http://www.bookmax.net/
http://www.ezyspot.com/
http://cadillactight.net/
http://cheapstockprice.com/
http://www.socialmedia1.com/
http://www.wedigg.co.uk/
http://www.linkagogo.com/
http://www.memotoo.com/
http://www.oyax.com/
http://www.mysitevote.com/
http://www.chaamp.com/
http://www.votelists.com/
http://www.wirefan.com/
http://www.sitesays.com/
http://www.actualtopics.com/
http://url.org/
http://www.wordsjournal.com/
http://www.folkd.com/
http://www.quickieclick.com/
http://www.addictionaire.com/
http://thuhm.com/
http://www.newsmeback.com/
http://www.yoorl.com/
http://pacenext.com/
http://bookmarkingactions.com/
http://publishednews.info/
http://peaksocial.com/
http://bookmarksubmission.com/
http://bookmarksite.net/
http://bookmarkingsite.net/
http://drigg-code.com/
http://bookmarkspiders.com/
http://esocialbookmarks.com/
http://caitax.net/
http://linksroll.com/
http://beststumbles.com/
http://buddymarks.com/
http://etagz.info/
http://www.social-bookmarking.net/
http://floatingdesigns.com/
http://8tag.com/
http://amaze24.com/
http://bookmarks.linksorter.com/
http://www.xscoops.com/
http://www.180blognetwork.com/
http://www.socialbookmarkdofollow.com/
http://fhot.net/
http://crunchour.com/
http://medicalogs.com/
http://linkerbook.com/
http://webdesigndefinitions.com/
http://socialsubjects.com/
http://www.yoomark.com/
http://addblogurl.com/
http://www.socialdofollow.com/
http://way2bookmarks.com/
http://www.liveonlinegame.com/
http://taagz.com/
http://koolontheweb.com/
http://hotbmark.com/
http://bookmarks.leadinglink.com/
http://lawrkhawm.com/
http://www.subbmitt.com/
http://www.therealpassport.com/
http://www.tungaw.com/
http://1morelink.com/
http://www.diggdirect.com/
http://www.zeezag.com/
http://www.alltopics.com/
http://metrotagz.com/
http://www.nuzcom.com/
http://neotags.info/
http://www.linkvote.com/
http://www.seedz.org/
http://www.buzzingtopics.com/
http://www.socialn.net/
http://www.thegreenroll.com/
http://clickfor.net/
http://under-link.com/
http://listyoururl.com/
http://multiplylinks.com/
http://b2blocal.info/
http://www.qazee.com/
http://www.newsmarked.info/
http://bookmarkingpalace.info/
http://www.reddit.com/
http://bookmarkarticles.com/
http://www.joontz.com/
http://clipbookmarks.com/
http://altnewsonline.com/
http://www.dlligo.com/
http://www.28g.co.uk/
http://www.a1socialbookmarking.com/
http://www.a1-webmarks.com/
http://www.newsgarbage.com/
http://www.persianhaps.com/
http://www.blummy.com/
http://www.elovr.com/
http://www.socialbookmarking.co.in
http://www.markered.info/
http://www.urlscentral.com/
http://www.weboworld.com/
http://www.webmaster911.com/
http://onlinesocialbookmarking.com/
http://www.dekut.com/
http://bytetags.com/
http://bookmarkroll.com/
http://stick2this.info/
http://fulloftags.info/
http://bookmarkshub.info/
http://aggrepress.com/
http://www.facbookmark.info/
http://www.onlinebookmark.info/
http://www.bookmarkmail.info/
http://www.buk-mark.com/
http://mycibb.com/
http://www.sitesbookmarking.com/
http://beamark.com/
http://www.yomash.com/
http://shareabargain.co.uk/
http://yasnw.com/
http://societyweb.info/
http://www.reizit.com/
http://www.hypeurl.com/
http://www.bestofindya.com/
http://www.connotea.org/
http://www.bmaccess.net/
http://www.squidoo.com/
http://www.lepiocheur.com/
http://www.mister-wong.com/
http://murl.com/
http://www.startaid.com/
http://www.ellepop.com/
http://www.bookmarkglobe.com/
http://phpdug.info/
http://www.totalpad.com/
http://www.bloob.net/
http://bookmarkspiders.com/
http://bookmarksubmission.com/
http://www.2dug.com/
http://www.pharmacy-scales.net/
http://www.snurf.in/
http://www.howtoxyz.com/
http://www.jewelry-scales-balances.com/
http://bookmark4seo.com/
http://www.ysome.com/
http://www.dropjack.com/
http://www.mypip.com/
http://bookmarks.oneindia.in/
http://www.business-planet.net/
http://www.gozoof.com/
http://www.tamilers.com/
http://zobbed.com/
http://www.citeulike.org/
http://www.mylinkvault.com/
http://spotback.com/
http://www.podshow411.net/
http://www.yattle.com/
http://suggestbookmark.info/
http://www.joseluispretto.com/
http://www.diigo.com/
http://www.snipit.org/
http://my.xmarks.com/
http://www.ez4u.net/
http://www.easybm.com/
http://www.corank.com/
https://www.mywebdesktop.net/
http://www.gather.com/
http://www.spurl.net/
http://www.free-web-submission.com/
http://www.joseluispretto.com/
http://malaysiastory.com/

Thursday, September 9, 2010

Social Networking


What is Social Networking ?

The Social Networking is most popular way of communicating group of individuals in todays world.
This group of individuals like an small rural communities or subdivision of society. The Social Networking is also most popular communicating method of the internet because unlike schools, universities and work places there are millions of people in the internet and there are people who are willing to share their information with others who have same interest.

Social Networking Sites

There are lots of sites that allow people to share their information with others. These social networking sites can be classified according to the information that they share.For example, general, financial, education and books, bookmarking and sharing, Art, dating , etc. Before share the knowledge with others we need to be a member of that society by creating account in that community. After being a member we can share our knowledge with networking society.