Package org.apache.poi.hwpf.converter

Examples of org.apache.poi.hwpf.converter.WordToTextConverter


    public String getText()
    {
        try
        {
            WordToTextConverter wordToTextConverter = new WordToTextConverter();
            wordToTextConverter.processDocument( doc );
            return wordToTextConverter.getText();
        }
        catch ( Exception exc )
        {
            // fall-back
            StringBuffer text = new StringBuffer();
View Full Code Here


    public String getText()
    {
        try
        {
            WordToTextConverter wordToTextConverter = new WordToTextConverter();
            wordToTextConverter.processDocument( doc );
            return wordToTextConverter.getText();
        }
        catch ( Exception exc )
        {
            // fall-back
            StringBuffer text = new StringBuffer();
View Full Code Here

     */
    public String getText()
    {
        try
        {
            WordToTextConverter wordToTextConverter = new WordToTextConverter();

            HeaderStories hs = new HeaderStories( doc );

            if ( hs.getFirstHeaderSubrange() != null )
                wordToTextConverter.processDocumentPart( doc,
                        hs.getFirstHeaderSubrange() );
            if ( hs.getEvenHeaderSubrange() != null )
                wordToTextConverter.processDocumentPart( doc,
                        hs.getEvenHeaderSubrange() );
            if ( hs.getOddHeaderSubrange() != null )
                wordToTextConverter.processDocumentPart( doc,
                        hs.getOddHeaderSubrange() );

            wordToTextConverter.processDocument( doc );
            wordToTextConverter.processDocumentPart( doc,
                    doc.getMainTextboxRange() );

            if ( hs.getFirstFooterSubrange() != null )
                wordToTextConverter.processDocumentPart( doc,
                        hs.getFirstFooterSubrange() );
            if ( hs.getEvenFooterSubrange() != null )
                wordToTextConverter.processDocumentPart( doc,
                        hs.getEvenFooterSubrange() );
            if ( hs.getOddFooterSubrange() != null )
                wordToTextConverter.processDocumentPart( doc,
                        hs.getOddFooterSubrange() );

            return wordToTextConverter.getText();
        }
        catch ( Exception exc )
        {
            throw new RuntimeException( exc );
        }
View Full Code Here

TOP

Related Classes of org.apache.poi.hwpf.converter.WordToTextConverter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.