public class HeaderFooter extends Rectangle
HeaderFooter-object is a Rectangle with text that can be put above and/or below every
page.
Example:
HeaderFooter header = new HeaderFooter(new Phrase("This is a header."), false);
HeaderFooter footer = new HeaderFooter(new Phrase("This is page "), new Phrase("."));
document.setHeader(header); document.setFooter(footer);
backgroundColor, border, borderColor, borderColorBottom, borderColorLeft, borderColorRight, borderColorTop, borderWidth, borderWidthBottom, borderWidthLeft, borderWidthRight, borderWidthTop, BOTTOM, BOX, LEFT, llx, lly, NO_BORDER, offsetToTop, RIGHT, rotation, TOP, UNDEFINED, urx, ury, useVariableBordersALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, FOOTNOTE, HEADER, IMGRAW, IMGTEMPLATE, JBIG2, JPEG, JPEG2000, KEYWORDS, LIST, LISTITEM, MARKED, MODIFICATIONDATE, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE, YMARK| Constructor and Description |
|---|
HeaderFooter(boolean numbered)
Constructs a
Header-object with only a pagenumber. |
HeaderFooter(boolean numbered,
Phrase after)
Constructs a
Header-object with a pagenumber at the beginning. |
HeaderFooter(Phrase before,
boolean numbered)
Constructs a
Header-object with a pagenumber at the end. |
HeaderFooter(Phrase before,
Phrase after)
Constructs a
HeaderFooter-object. |
| Modifier and Type | Method and Description |
|---|---|
void |
addPadding(float augment)
Increases current padding by adding new value into it
|
void |
addSpecialContent(Element element)
Adds non-text
Element into specialContent |
int |
alignment()
Gets the alignment of this HeaderFooter.
|
Phrase |
getAfter()
Gets the part that comes after the pageNumber.
|
Phrase |
getBefore()
Gets the part that comes before the pageNumber.
|
float |
getPadding()
Gets padding of height of header/footer.
|
List<Element> |
getSpecialContent()
Gets
specialContent |
boolean |
isNumbered()
Checks if the HeaderFooter contains a page number.
|
Paragraph |
paragraph()
Gets the
Paragraph that can be used as header or footer. |
void |
setAlignment(int alignment)
Sets the alignment.
|
void |
setPadding(float padding)
Sets padding of height of header/footer.
|
void |
setPageNumber(int pageN)
Sets the page number.
|
cloneNonPositionParameters, disableBorderSide, enableBorderSide, getBackgroundColor, getBorder, getBorderColor, getBorderColorBottom, getBorderColorLeft, getBorderColorRight, getBorderColorTop, getBorderWidth, getBorderWidthBottom, getBorderWidthLeft, getBorderWidthRight, getBorderWidthTop, getBottom, getBottom, getChunks, getGrayFill, getHeight, getLeft, getLeft, getRelativeTop, getRight, getRight, getRotation, getTop, getTop, getWidth, hasBorder, hasBorders, isContent, isNestable, isUseVariableBorders, normalize, process, rectangle, rotate, setBackgroundColor, setBorder, setBorderColor, setBorderColorBottom, setBorderColorLeft, setBorderColorRight, setBorderColorTop, setBorderWidth, setBorderWidthBottom, setBorderWidthLeft, setBorderWidthRight, setBorderWidthTop, setBottom, setGrayFill, setLeft, setRelativeTop, setRight, setRotation, setTop, setUseVariableBorders, softCloneNonPositionParameters, toString, typepublic HeaderFooter(Phrase before, Phrase after)
HeaderFooter-object.before - the Phrase before the pagenumberafter - the Phrase before the pagenumberpublic HeaderFooter(Phrase before, boolean numbered)
Header-object with a pagenumber at the end.before - the Phrase before the pagenumbernumbered - page will be numbered if truepublic HeaderFooter(boolean numbered,
Phrase after)
Header-object with a pagenumber at the beginning.numbered - page will be numbered if trueafter - the Phrase after the pagenumberpublic HeaderFooter(boolean numbered)
Header-object with only a pagenumber.numbered - true if the page has to be numberedpublic boolean isNumbered()
public Phrase getBefore()
public Phrase getAfter()
public void setPageNumber(int pageN)
pageN - the new page numberpublic void setAlignment(int alignment)
alignment - the new alignmentpublic float getPadding()
public void setPadding(float padding)
padding - the new padding of heightpublic void addPadding(float augment)
augment - the new valuepublic void addSpecialContent(Element element)
Element into specialContentelement - the new non-text Elementpublic List<Element> getSpecialContent()
specialContentspecialContentpublic Paragraph paragraph()
Paragraph that can be used as header or footer.Paragraphpublic int alignment()
Copyright © 2024. All rights reserved.