poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Baby Periasamy <babyperiyas...@gmail.com>
Subject Re: Read Word document and display it with in a textarea of jsp
Date Fri, 15 Jul 2011 13:30:33 GMT
Hi Nick,

Thank you. i have followed that test class. Now i am able to get the
contents in the html form for table, content and images.

Tha problem here is, the font color and styles are missing in the retrieved
html. And where the image will be stored? The image is coming as x in the
jsp page.

Tha contents are only plain html.

Below is the code I've used,

    Metadata metadata = new Metadata();
    StringWriter sw = new StringWriter();
    SAXTransformerFactory factory = (SAXTransformerFactory)
    TransformerHandler handler = factory.newTransformerHandler();
    handler.getTransformer().setOutputProperty(OutputKeys.METHOD, "xml");
    handler.getTransformer().setOutputProperty(OutputKeys.INDENT, "yes");
    sw = new StringWriter();
    handler.setResult(new StreamResult(sw));
    input = OOXMLParser.class.getResourceAsStream(filePath);//
    //input = new FileInputStream(fileDirectoryPath);  
        new OfficeParser().parse(TikaInputStream.get(input), handler,
metadata, new ParseContext());
        xml = sw.toString();
        System.out.println("xml test "+xml);

Plz help me out. 

Baby Periasamy.

View this message in context: http://apache-poi.1045710.n5.nabble.com/Read-Word-document-and-display-it-with-in-a-textarea-of-jsp-tp4581911p4590667.html
Sent from the POI - User mailing list archive at Nabble.com.

To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org

View raw message