i want to convert text which is written in .gif file into .txt or .doc formate.
although i have converted .gif into .pdf but i want into .txt or .doc.
although m able to convert it from .gif to .pdf but i want to convert it from .gif to .txt or .doc
below is the code for .gif to .pdf
import java.io.FileOutputStream;
//com.lowagie... old version
//com.itextpdf... recent version
import com.itextpdf.text.DocListener;
import com.itextpdf.text.Document;
import com.itextpdf.text.pdf.PdfWriter;
import com.itextpdf.text.pdf.codec.TiffWriter;
import com.itextpdf.text.Image;
public class ImageToPDF {
public static void main(String []args) {
Document document = new Document();
String input = "E:/Softwares/jars/error.png"; // .gif and .jpg are ok too!
String output = "E:/Softwares/jars/capture.pdf";
try {
FileOutputStream fos = new FileOutputStream(output);
PdfWriter writer = PdfWriter.getInstance(document, fos);
// TiffWriter writer=TiffWriter.getInstance(document,fos);
((DocListener) writer).open();
document.open();
document.add(Image.getInstance(input));
document.close();
writer.close();
System.out.println("in try");
}
catch (Exception e) {
e.printStackTrace();
}
}
}