Win a copy of Head First Android this week in the Android forum!

vamshi gurudu

Greenhorn
+ Follow
since Sep 23, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by vamshi gurudu

Thanks for replies.

I had solved the problem
Below is the sample code.

For DOC : org.apache.poi.hwpf.extractor.WordExtractor.WordExtractor(InputStream is) if its throw exception then i am using org.apache.poi.xwpf.usermodel.XWPFDocument.XWPFDocument(InputStream is)

For DOCX : org.apache.poi.xwpf.extractor.XWPFWordExtractor.XWPFWordExtractor

For rtf : javax.swing.text.rtf.RTFEditorKit.RTFEditorKit()

all this will convert to text.

Thanks Rob Spoor your reply gave me to do some experiment.

Thanks both of you for giving such a good information.


10 years ago
Hi All,

I want to convert Doc, Docx and rtf files to text format.
Below is my code.

import java.io.*;
import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
import org.apache.poi.xwpf.usermodel.XWPFDocument;

public class DocToText {
public static void main(String[] args) {
File file = null;

try {
// Read the Doc/DOCx file
file = new File("E:\\Search.doc");
FileInputStream fis = new FileInputStream(file.getAbsolutePath());
XWPFDocument doc = new XWPFDocument(fis);
XWPFWordExtractor ex = new XWPFWordExtractor(doc);
String text = ex.getText();

//write the text in txt file
File fil = new File("E:\\New.txt");
Writer output = new BufferedWriter(new FileWriter(fil));
output.write(text);
output.close();
} catch (Exception exep) {
exep.printStackTrace();
}
}
}

For some files it is working properly, but some file i am getting the exception as
org.apache.poi.openxml4j.exceptions.InvalidFormatException: Package should contain a content type part [M1.13].

How to resolve the issue, any help.

Thanks.
10 years ago
Hello Amit,

For code is working for some files only.
For some files i got the exception as org.apache.poi.openxml4j.exceptions.InvalidFormatException: Package should contain a content type part [M1.13]

How to resolve this.

Thanks.
10 years ago
HI,

I want display byte array in to image using java script, any help.

Actually i am inserting image in to mysql database using blob, image is converted to byte array.
I am retrieving all the table values using json array and displaying using javascript, in the json array i am adding this image byte array also.
I am able to retrieve the other values, but not able to display this byte array as image.


Thanks.
HI,

try to add displaytag-1.2.jar in your lib folder then restart the server.
May be it will work.

10 years ago
HI,

Thanks for the reply, it's working.
Actually i am developing a chat application, i am rendering the data in to div using ajax.
So i need to refresh the div to get new chat messages.

Thank you this code is working for me.


Thanks.
Hi All,

How to refresh a particular DIV for every 5 sec.

Thanks.
HI All,

How to send push notifications to android using java.

Thanks.
10 years ago
Hi All,

I have 2 arraylists one list contains all responses.
Another list having display fields like firstname, lastname etc..

eg: arraylist1 having all responses like a,b,c,d,e.

arraylist 2 having only firstname,lastname

i have to display firstname a
lastname b.

using display tag.

how to get the result.

Thanks.
11 years ago
Hi Thanks i got it.
I have replaced my struts jars with 1.2, now it is working.

Thanks.
11 years ago
Hi Thanks for reply.

But when i am using action path like below it shows Invalid path /filesearch was requested



My link is filesearch.do when clicking on this link it shows Invalid path /filesearch was requested.

com.abc.SimpleAction will always send success.

Thanks.
11 years ago
Hi All,

I am using struts 1.2, Can we give * in action path for example



Thanks.
11 years ago
hi thanks, i have tried this also but no use.
Hi All,

In my FCK editor every user accessing images when clicking on browse in image upload.
I want one user can only see his images, how to handle this?

Thanks.
Hi Thanks for your reply, there are no errors, it is working fine in Mozilla.
In IE i frame is loading but at sudden the PayPal page goes out of the frame.
Not able to fix this.