DS Server

PageBorder Object

Object|Introduced in 26.0

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

PageBorder

Examples

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

MethodDescription
getBottomDistanceGets the distance, in twips, of the bottom border line either from the edge of the page or from the text, depending on the MeasureFromText.
getBottomLineColorGets the color of the bottom border line.
getBottomLineWidthGets the width of the bottom border line.
getFirstPageOnlyGets whether the page border is drawn only on the first page of the section.
getLeftDistanceGets the distance, in twips, of the left border line either from the edge of the page or from the text, depending on the MeasureFromText.
getLeftLineColorGets the color of the left border line.
getLeftLineWidthGets the width of the left border line.
getMeasureFromTextGets whether the page border's distances are measured from the text.
getOmitFirstPageGets whether the page border is not drawn on the first page of the section.
getRightDistanceGets the distance, in twips, of the right border line either from the edge of the page or from the text, depending on the MeasureFromText.
getRightLineColorGets the color of the right border line.
getRightLineWidthGets the width of the right border line.
getSurroundFooterGets whether the page border surrounds the section's footer.
getSurroundHeaderGets whether the page border surrounds the section's header.
getTopDistanceGets 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}.
getTopLineColorGets the color of the top border line.
getTopLineWidthGets the width of the top border line.
setBottomDistanceSets the distance, in twips, of the bottom border line either from the edge of the page or from the text, depending on the MeasureFromText.
setBottomLineColorSets the color of the bottom border line.
setBottomLineWidthSets the width of the bottom border line.
setFirstPageOnlySets whether the page border is drawn only on the first page of the section.
setLeftDistanceSets the distance, in twips, of the left border line either from the edge of the page or from the text, depending on the MeasureFromText.
setLeftLineColorSets the color of the left border line.
setLeftLineWidthSets the width of the left border line.
setMeasureFromTextSets whether the page border's distances are measured from the text.
setOmitFirstPageSets whether the page border is not drawn on the first page of the section.
setRightDistanceSets the distance, in twips, of the right border line either from the edge of the page or from the text, depending on the MeasureFromText.
setRightLineColorSets the color of the right border line.
setRightLineWidthSets the width of the right border line.
setSurroundFooterSets the whether the page border surrounds the section's footer.
setSurroundHeaderSets the whether the page border surrounds the section's header.
setTopDistanceSets the distance, in twips, of the top border line either from the edge of the page or from the text, depending on the MeasureFromText.
setTopLineColorSets the color of the top border line.
setTopLineWidthSets the width of the top border line.

Enumerations

EnumerationDescription
AttributeDetermines a certain page border attribute.