You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by MBiel <mi...@o2.pl> on 2020/01/03 14:22:35 UTC

Replacing headers/footers in XWPFDocument

Hello all,
I'm just starting using POI for docx. I need to replace headers/footers in
document with a new ones taken from another document (whole content
including pictures, tables fields, etc). Is it possible with POI?
Any tips would be appreciated?

Thanks Mirek



--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-Dev-f2312866.html

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


Re: Replacing headers/footers in XWPFDocument

Posted by Eliot Kimber <ek...@contrext.com>.
It is possible but it takes a little more work than it should with the current API.

In my Wordinator project (https://github.com/drmacro/wordinator) I implemented support for generating DOCX files with multiple sections with section-specific headers and footers. You can crib the code I wrote (org.wordinator.xml2docx.generator.DocxGenerator.makeHeaderFooter(XWPFHeaderFooter, XmlObject))

I also see that I started working on an enhancement to the POI API for headers and footers but got sidetracked and haven't finished it--I don't know if I'll be able to find time for this but I still have my work lying around.

Cheers,

E.

--
Eliot Kimber
http://contrext.com
 

On 1/3/20, 8:22 AM, "MBiel" <mi...@o2.pl> wrote:

    Hello all,
    I'm just starting using POI for docx. I need to replace headers/footers in
    document with a new ones taken from another document (whole content
    including pictures, tables fields, etc). Is it possible with POI?
    Any tips would be appreciated?
    
    Thanks Mirek
    
    
    
    --
    Sent from: http://apache-poi.1045710.n5.nabble.com/POI-Dev-f2312866.html
    
    ---------------------------------------------------------------------
    To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
    For additional commands, e-mail: dev-help@poi.apache.org
    
    
    



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