poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Vladimirov <vlser...@gmail.com>
Subject Re: how to extract header & footer in wordtohtml converter poi
Date Thu, 11 Aug 2011 20:52:24 GMT
Rajeev,

New API for that is just commited in trunk. Consider the following
example (it can be used both for Word-to-HTML and Word-to-Text):

        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() );

This example is actually part of WordExtractor class code.

Sergey

On Thu, Aug 11, 2011 at 4:59 PM, Rajeev Mohanraj <rajeevabcon@gmail.com> wrote:
> Hi,
>
> am using wordtohtml converter class of poi & convert word document as html. it
> convert as html fine. but it leaves the header & footer. i need to get
> document overall range. how to do this in wordtohtml converter. Pls help me
> out? its very urgent for me.
>
> Advance Thanks
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>



-- 
Sergey Vladimirov

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


Mime
View raw message