|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.poi.xwpf.model.XWPFHeaderFooterPolicy
public class XWPFHeaderFooterPolicy
A .docx file can have no headers/footers, the same header/footer on each page, odd/even page footers, and optionally also a different header/footer on the first page. This class handles sorting out what there is, and giving you the right headers and footers for the document.
Field Summary | |
---|---|
static org.openxmlformats.schemas.wordprocessingml.x2006.main.STHdrFtr.Enum |
DEFAULT
|
static org.openxmlformats.schemas.wordprocessingml.x2006.main.STHdrFtr.Enum |
EVEN
|
static org.openxmlformats.schemas.wordprocessingml.x2006.main.STHdrFtr.Enum |
FIRST
|
Constructor Summary | |
---|---|
XWPFHeaderFooterPolicy(XWPFDocument doc)
Figures out the policy for the given document, and creates any header and footer objects as required. |
|
XWPFHeaderFooterPolicy(XWPFDocument doc,
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSectPr sectPr)
Figures out the policy for the given document, and creates any header and footer objects as required. |
Method Summary | |
---|---|
XWPFFooter |
createFooter(org.openxmlformats.schemas.wordprocessingml.x2006.main.STHdrFtr.Enum type)
Creates an empty footer of the specified type, containing a single empty paragraph, to which you can then set text, add more paragraphs etc. |
XWPFFooter |
createFooter(org.openxmlformats.schemas.wordprocessingml.x2006.main.STHdrFtr.Enum type,
XWPFParagraph[] pars)
Creates a new footer of the specified type, to which the supplied (and previously unattached!) paragraphs are added to. |
XWPFHeader |
createHeader(org.openxmlformats.schemas.wordprocessingml.x2006.main.STHdrFtr.Enum type)
Creates an empty header of the specified type, containing a single empty paragraph, to which you can then set text, add more paragraphs etc. |
XWPFHeader |
createHeader(org.openxmlformats.schemas.wordprocessingml.x2006.main.STHdrFtr.Enum type,
XWPFParagraph[] pars)
Creates a new header of the specified type, to which the supplied (and previously unattached!) paragraphs are added to. |
void |
createWatermark(java.lang.String text)
|
XWPFFooter |
getDefaultFooter()
|
XWPFHeader |
getDefaultHeader()
|
XWPFFooter |
getEvenPageFooter()
|
XWPFHeader |
getEvenPageHeader()
|
XWPFFooter |
getFirstPageFooter()
|
XWPFHeader |
getFirstPageHeader()
|
XWPFFooter |
getFooter(int pageNumber)
Get the footer that applies to the given (1 based) page. |
XWPFFooter |
getFooter(org.openxmlformats.schemas.wordprocessingml.x2006.main.STHdrFtr.Enum type)
Get this section footer for the given type |
XWPFHeader |
getHeader(int pageNumber)
Get the header that applies to the given (1 based) page. |
XWPFHeader |
getHeader(org.openxmlformats.schemas.wordprocessingml.x2006.main.STHdrFtr.Enum type)
Get this section header for the given type |
XWPFFooter |
getOddPageFooter()
Returns the odd page footer. |
XWPFHeader |
getOddPageHeader()
Returns the odd page header. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.openxmlformats.schemas.wordprocessingml.x2006.main.STHdrFtr.Enum DEFAULT
public static final org.openxmlformats.schemas.wordprocessingml.x2006.main.STHdrFtr.Enum EVEN
public static final org.openxmlformats.schemas.wordprocessingml.x2006.main.STHdrFtr.Enum FIRST
Constructor Detail |
---|
public XWPFHeaderFooterPolicy(XWPFDocument doc)
public XWPFHeaderFooterPolicy(XWPFDocument doc, org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSectPr sectPr)
Method Detail |
---|
public XWPFHeader createHeader(org.openxmlformats.schemas.wordprocessingml.x2006.main.STHdrFtr.Enum type)
public XWPFHeader createHeader(org.openxmlformats.schemas.wordprocessingml.x2006.main.STHdrFtr.Enum type, XWPFParagraph[] pars)
public XWPFFooter createFooter(org.openxmlformats.schemas.wordprocessingml.x2006.main.STHdrFtr.Enum type)
public XWPFFooter createFooter(org.openxmlformats.schemas.wordprocessingml.x2006.main.STHdrFtr.Enum type, XWPFParagraph[] pars)
public XWPFHeader getFirstPageHeader()
public XWPFFooter getFirstPageFooter()
public XWPFHeader getOddPageHeader()
public XWPFFooter getOddPageFooter()
public XWPFHeader getEvenPageHeader()
public XWPFFooter getEvenPageFooter()
public XWPFHeader getDefaultHeader()
public XWPFFooter getDefaultFooter()
public XWPFHeader getHeader(int pageNumber)
pageNumber
- The one based page numberpublic XWPFHeader getHeader(org.openxmlformats.schemas.wordprocessingml.x2006.main.STHdrFtr.Enum type)
type
- of header to return
XWPFHeader
objectpublic XWPFFooter getFooter(int pageNumber)
pageNumber
- The one based page numberpublic XWPFFooter getFooter(org.openxmlformats.schemas.wordprocessingml.x2006.main.STHdrFtr.Enum type)
type
- of footer to return
XWPFFooter
objectpublic void createWatermark(java.lang.String text)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |