Click here to Skip to main content
15,897,371 members
Home / Discussions / Java
   

Java

 
GeneralRe: how to make a listener to receive from HttpConnection Pin
williamroma13-May-11 13:13
williamroma13-May-11 13:13 
GeneralRe: how to make a listener to receive from HttpConnection Pin
williamroma13-May-11 13:15
williamroma13-May-11 13:15 
GeneralRe: how to make a listener to receive from HttpConnection Pin
williamroma13-May-11 9:11
williamroma13-May-11 9:11 
GeneralRe: how to make a listener to receive from HttpConnection Pin
jschell13-May-11 12:15
jschell13-May-11 12:15 
Questionhow to read exact content of word in java Pin
priya218411-May-11 0:03
priya218411-May-11 0:03 
AnswerRe: how to read exact content of word in java Pin
Nagy Vilmos11-May-11 0:13
professionalNagy Vilmos11-May-11 0:13 
AnswerRe: how to read exact content of word in java Pin
JP_Rocks29-May-11 22:34
JP_Rocks29-May-11 22:34 
Questionhow to read exact content of word in java Pin
priya218411-May-11 0:02
priya218411-May-11 0:02 
Sir ,
Can any one help me in reading the exact word content.
I have the following code with me:

_____***********Code start here*********----------------

import java.io.File;
import java.io.FileInputStream;

import org.apache.poi.hwpf.HWPFDocument;
import org.apache.poi.hwpf.extractor.WordExtractor;

public class DocRead1 {

public void readDocFile() {
File docFile = null;
WordExtractor docExtractor = null ;
WordExtractor exprExtractor = null ;
try {
docFile = new File("/Users/priyaranjan/Desktop/Hello.doc");
//A FileInputStream obtains input bytes from a file.
FileInputStream fis=new FileInputStream(docFile.getAbsolutePath());

//A HWPFDocument used to read document file from FileInputStream
HWPFDocument doc=new HWPFDocument(fis);

docExtractor = new WordExtractor(doc);
}
catch(Exception exep)
{
System.out.println(exep.getMessage());
}

//This Array stores each line from the document file.
String [] docArray = docExtractor.getParagraphText();

for(int i=0;i<docArray.length;i++)
{
if(docArray[i] != null)
System.out.println("Line "+ i +" : " + docArray[i]);
}
}

public static void main(String[] args) {
DocRead1 reader = new DocRead1();
reader.readDocFile();
}
}

------------*****************________________________



But i am getting the same out put whenever i made a change in font of letters used in word.I mean suppose in first case i have made the letter bold then in the second case i have made the letters italics.
But the above program is giving me the same output in both the case.I want to read the exact content of word document.

Can any one help me in this case...

Regards,
Priya
AnswerRe: how to read exact content of word in java Pin
Nagy Vilmos11-May-11 0:17
professionalNagy Vilmos11-May-11 0:17 
QuestionCreating an object of a superclass Pin
kurt110-May-11 9:20
kurt110-May-11 9:20 
AnswerRe: Creating an object of a superclass [modified] Pin
Luc Pattyn10-May-11 12:43
sitebuilderLuc Pattyn10-May-11 12:43 
AnswerRe: Creating an object of a superclass Pin
Nagy Vilmos10-May-11 23:11
professionalNagy Vilmos10-May-11 23:11 
GeneralRe: Creating an object of a superclass Pin
Luc Pattyn11-May-11 0:54
sitebuilderLuc Pattyn11-May-11 0:54 
AnswerRe: Creating an object of a superclass Pin
jschell11-May-11 8:49
jschell11-May-11 8:49 
QuestionHow to get only modified files from vss using ant scripts [modified] Pin
Payam Rastogi9-May-11 19:27
Payam Rastogi9-May-11 19:27 
AnswerRe: How to get only modified files from vss using ant scripts Pin
Richard MacCutchan9-May-11 22:06
mveRichard MacCutchan9-May-11 22:06 
GeneralRe: How to get only modified files from vss using ant scripts Pin
David Skelly9-May-11 22:35
David Skelly9-May-11 22:35 
GeneralRe: How to get only modified files from vss using ant scripts Pin
Richard MacCutchan10-May-11 12:07
mveRichard MacCutchan10-May-11 12:07 
AnswerRe: How to get only modified files from vss using ant scripts Pin
TorstenH.10-May-11 4:10
TorstenH.10-May-11 4:10 
AnswerRe: How to get only modified files from vss using ant scripts Pin
jschell10-May-11 11:56
jschell10-May-11 11:56 
GeneralRe: How to get only modified files from vss using ant scripts Pin
David Skelly10-May-11 22:19
David Skelly10-May-11 22:19 
Questionrandom runtime crash Pin
kartikdasani9-May-11 3:12
kartikdasani9-May-11 3:12 
AnswerRe: random runtime crash Pin
Nagy Vilmos9-May-11 3:31
professionalNagy Vilmos9-May-11 3:31 
GeneralRe: random runtime crash Pin
jschell9-May-11 9:34
jschell9-May-11 9:34 
AnswerRe: random runtime crash Pin
jschell9-May-11 9:37
jschell9-May-11 9:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.