PageBorder Object
Description
The PageBorder represents the attributes of a border, which is drawn in the margin area of a page. A page border can have a top, left, right or bottom line or a combination of these lines. The line width and the color can be defined for each line separately. For each line a distance can be specified, which is either a distance to the edge of the page or to the text. The page border can surround the text including page headers and footers or only the text of the page. The border can be defined for the first page, for all pages or beginning with the second page.
Syntax
PageBorderExamples
The following example demonstrates PageBorder in a practical document-editing workflow. The PageBorder represents the attributes of a border, which is drawn in the margin area of a page. A page border can have a top, left, right or bottom line or a combination of these lines. The line width and the color can be defined for each line separately. For each line a distance can be specified, which is either a distance to the edge of the page or to the text. The page border can surround the text including page headers and footers or only the text of the page. The border can be defined for the first page, for all pages or beginning with the second page.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function inspectPageBorder(pageBorder) {
pageBorder.getBottomDistance(
function(result) {
console.log("get bottom distance result:", result);
},
onTxError
);
}Members
Methods
| Method | Description |
|---|---|
| getBottomDistance | Gets the distance, in twips, of the bottom border line either from the edge of the page or from the text, depending on the MeasureFromText. |
| getBottomLineColor | Gets the color of the bottom border line. |
| getBottomLineWidth | Gets the width of the bottom border line. |
| getFirstPageOnly | Gets whether the page border is drawn only on the first page of the section. |
| getLeftDistance | Gets the distance, in twips, of the left border line either from the edge of the page or from the text, depending on the MeasureFromText. |
| getLeftLineColor | Gets the color of the left border line. |
| getLeftLineWidth | Gets the width of the left border line. |
| getMeasureFromText | Gets whether the page border's distances are measured from the text. |
| getOmitFirstPage | Gets whether the page border is not drawn on the first page of the section. |
| getRightDistance | Gets the distance, in twips, of the right border line either from the edge of the page or from the text, depending on the MeasureFromText. |
| getRightLineColor | Gets the color of the right border line. |
| getRightLineWidth | Gets the width of the right border line. |
| getSurroundFooter | Gets whether the page border surrounds the section's footer. |
| getSurroundHeader | Gets whether the page border surrounds the section's header. |
| getTopDistance | Gets the distance, in twips, of the top border line either from the edge of the page or from the text, depending on the {@link MeasureFromText}. |
| getTopLineColor | Gets the color of the top border line. |
| getTopLineWidth | Gets the width of the top border line. |
| setBottomDistance | Sets the distance, in twips, of the bottom border line either from the edge of the page or from the text, depending on the MeasureFromText. |
| setBottomLineColor | Sets the color of the bottom border line. |
| setBottomLineWidth | Sets the width of the bottom border line. |
| setFirstPageOnly | Sets whether the page border is drawn only on the first page of the section. |
| setLeftDistance | Sets the distance, in twips, of the left border line either from the edge of the page or from the text, depending on the MeasureFromText. |
| setLeftLineColor | Sets the color of the left border line. |
| setLeftLineWidth | Sets the width of the left border line. |
| setMeasureFromText | Sets whether the page border's distances are measured from the text. |
| setOmitFirstPage | Sets whether the page border is not drawn on the first page of the section. |
| setRightDistance | Sets the distance, in twips, of the right border line either from the edge of the page or from the text, depending on the MeasureFromText. |
| setRightLineColor | Sets the color of the right border line. |
| setRightLineWidth | Sets the width of the right border line. |
| setSurroundFooter | Sets the whether the page border surrounds the section's footer. |
| setSurroundHeader | Sets the whether the page border surrounds the section's header. |
| setTopDistance | Sets the distance, in twips, of the top border line either from the edge of the page or from the text, depending on the MeasureFromText. |
| setTopLineColor | Sets the color of the top border line. |
| setTopLineWidth | Sets the width of the top border line. |
Enumerations
| Enumeration | Description |
|---|---|
| Attribute | Determines a certain page border attribute. |