|
com.aspose.pdf.elements
Class HeaderFooter
java.lang.Object
com.aspose.pdf.elements.HeaderFooter
public class HeaderFooter - extends java.lang.Object
Represents a header or footer of a page in a Pdf document.
|
Constructor Summary |
HeaderFooter(Section section)
Initialize a new instance of the IT_HeaderFooter class. |
|
Method Summary |
java.lang.Object |
clone()
|
BorderInfo |
getBorderInfo()
Get the BordefInfo for this HeaderFooter |
float |
getDistanceFromEdge()
Gets a float value that indicates the Header or Footer's distance from
the edge of the page.The unit is point. |
GraphInfo |
getGraphInfo()
Gets a GraphInfo that indicates graph info of the section. |
MarginInfo |
getMarginInfo()
Gets a MarginInfo object that indicates the margin info of the header or footer. |
Paragraphs |
getParagraphs()
Gets a Paragraphs collection that indicates all paragraphs in the header or footer before
the page number( if page number is included). |
Section |
getSection()
Get the Section owns this HeaderFooter |
TextInfo |
getTextInfo()
Gets a TextInfo object that indicates the text info of the header or footer. |
boolean |
isFirstPageOnly()
Gets a bool value that indicates whether the header or footer be printed
on first page only. |
boolean |
isLastPageOnly()
Gets a bool value that indicates whether the header or footer be printed on last page only.
The default value is false. |
boolean |
isSubsequentPagesOnly()
Gets a bool value that indicates whether the header or footer be printed not on first page
but on subsequent pages only. |
void |
setBorderInfo(BorderInfo info)
Set the BordefInfo for this HeaderFooter |
void |
setDistanceFromEdge(float distanceFromEdge)
Sets a float value that indicates the Header or Footer's distance from
the edge of the page.The unit is point. |
void |
setGraphInfo(GraphInfo graphInfo)
Sets a GraphInfo that indicates graph info of the section. |
void |
setIsFirstPageOnly(boolean firstPageOnly)
Sets a bool value that indicates whether the header or footer be printed
on first page only. |
void |
setIsLastPageOnly(boolean lastPageOnly)
Sets a bool value that indicates whether the header or footer be printed on last page only.
The default value is false. |
void |
setIsSubsequentPagesOnly(boolean subsequentPagesOnly)
Sets a bool value that indicates whether the header or footer be printed not on first page
but on subsequent pages only. |
void |
setMarginInfo(MarginInfo marginInfo)
Sets a MarginInfo object that indicates the margin info of the header or footer. |
void |
setParagraphs(Paragraphs paragraphs)
Sets a Paragraphs collection that indicates all paragraphs in the header or footer. |
void |
setSection(Section section)
|
void |
setTextInfo(TextInfo textInfo)
Sets a TextInfo object that indicates the text info of the header or footer. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HeaderFooter
public HeaderFooter(Section section)
- Initialize a new instance of the IT_HeaderFooter class.
[SampleCode]
Pdf pdf = new Pdf();
Section sec1 = pdf.getSections().add();
Text text1 = new Text(sec1,"This example domestrates how to use pdf header and footer.");
sec1.getParagraphs().add(text1);
IT_HeaderFooter head = new IT_HeaderFooter(sec1);
Text headText = new Text(sec1,"Aspose IT_HeaderFooter");
head.setHerderHeight(30);
head.setHeaderText(headText);
sec1.setHeader(head);
- Parameters:
section - The Section that owns the header.
clone
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
- Overrides:
clone in class java.lang.Object
- Throws:
java.lang.CloneNotSupportedException- See Also:
Object.clone()
getGraphInfo
public GraphInfo getGraphInfo()
- Gets a GraphInfo that indicates graph info of the section.
- Returns:
- Returns the GraphInfo.
setGraphInfo
public void setGraphInfo(GraphInfo graphInfo)
- Sets a GraphInfo that indicates graph info of the section.
- Parameters:
graphInfo - The GraphInfo to set.
isFirstPageOnly
public boolean isFirstPageOnly()
- Gets a bool value that indicates whether the header or footer be printed
on first page only. The default value is false.If this property is set to true,
the IsSubsequentPagesOnly should be false.
- Returns:
- Returns the IsFirstPageOnly.
setIsFirstPageOnly
public void setIsFirstPageOnly(boolean firstPageOnly)
- Sets a bool value that indicates whether the header or footer be printed
on first page only. The default value is false.If this property is set to true,
the IsSubsequentPagesOnly should be false.
- Parameters:
firstPageOnly - The IsFirstPageOnly to set.
isLastPageOnly
public boolean isLastPageOnly()
- Gets a bool value that indicates whether the header or footer be printed on last page only.
The default value is false.
setIsLastPageOnly
public void setIsLastPageOnly(boolean lastPageOnly)
- Sets a bool value that indicates whether the header or footer be printed on last page only.
The default value is false.
- Parameters:
lastPageOnly - The IsLastPageOnly to set.
isSubsequentPagesOnly
public boolean isSubsequentPagesOnly()
- Gets a bool value that indicates whether the header or footer be printed not on first page
but on subsequent pages only. The default value is false. If this property is set to true,
the IsFirstPageOnly should be false.
- Returns:
- Returns the IsSubsequentPagesOnly.
setIsSubsequentPagesOnly
public void setIsSubsequentPagesOnly(boolean subsequentPagesOnly)
- Sets a bool value that indicates whether the header or footer be printed not on first page
but on subsequent pages only. The default value is false. If this property is set to true,
the IsFirstPageOnly should be false.
- Parameters:
subsequentPagesOnly - The IsSubsequentPagesOnly to set.
getMarginInfo
public MarginInfo getMarginInfo()
- Gets a MarginInfo object that indicates the margin info of the header or footer.
- Returns:
- Returns the MarginInfo.
setMarginInfo
public void setMarginInfo(MarginInfo marginInfo)
- Sets a MarginInfo object that indicates the margin info of the header or footer.
- Parameters:
marginInfo - The MarginInfo to set.
getParagraphs
public Paragraphs getParagraphs()
- Gets a Paragraphs collection that indicates all paragraphs in the header or footer before
the page number( if page number is included).
- Returns:
- Returns the paragraphs.
setParagraphs
public void setParagraphs(Paragraphs paragraphs)
- Sets a Paragraphs collection that indicates all paragraphs in the header or footer.
- Parameters:
paragraphs - The paragraphs to set.
getTextInfo
public TextInfo getTextInfo()
- Gets a TextInfo object that indicates the text info of the header or footer.
- Returns:
- Returns the TextInfo.
setTextInfo
public void setTextInfo(TextInfo textInfo)
- Sets a TextInfo object that indicates the text info of the header or footer.
- Parameters:
textInfo - The TextInfo to set.
getBorderInfo
public BorderInfo getBorderInfo()
- Get the BordefInfo for this HeaderFooter
setBorderInfo
public void setBorderInfo(BorderInfo info)
- Set the BordefInfo for this HeaderFooter
getSection
public Section getSection()
- Get the Section owns this HeaderFooter
setSection
public void setSection(Section section)
getDistanceFromEdge
public float getDistanceFromEdge()
- Gets a float value that indicates the Header or Footer's distance from
the edge of the page.The unit is point. In XML,the default unit is point,but cm
and inch are also supported. For example,"10cm" or "5inch".
- Returns:
- the distance from edge
setDistanceFromEdge
public void setDistanceFromEdge(float distanceFromEdge)
- Sets a float value that indicates the Header or Footer's distance from
the edge of the page.The unit is point. In XML,the default unit is point,but cm
and inch are also supported. For example,"10cm" or "5inch".
- Parameters:
distanceFromEdge - the distance you want to set
|