Border class
Border class
Represents a border of an object. To learn more, visit the Programming with Documents documentation article.
Remarks
Borders can be applied to various document elements including paragraph, run of text inside a paragraph or a table cell.
Inheritance: Border → InternableComplexAttr
Properties
Name | Description |
---|---|
color | Gets or sets the border color. |
distanceFromText | Gets or sets distance of the border from text or from the page edge in points. |
isVisible | Returns true if the Border.lineStyle is not LineStyle.None. |
lineStyle | Gets or sets the border style. |
lineWidth | Gets or sets the border width in points. |
shadow | Gets or sets a value indicating whether the border has a shadow. |
themeColor | Gets or sets the theme color in the applied color scheme that is associated with this Border object. |
tintAndShade | Gets or sets a double value that lightens or darkens a color. |
Methods
Name | Description |
---|---|
clearFormatting() | Resets border properties to default values. |
equals(rhs) | Determines whether the specified border is equal in value to the current border. |
Examples
Shows how to insert a string surrounded by a border into a document.
let doc = new aw.Document();
let builder = new aw.DocumentBuilder(doc);
builder.font.border.color = "#008000";
builder.font.border.lineWidth = 2.5;
builder.font.border.lineStyle = aw.LineStyle.DashDotStroker;
builder.write("Text surrounded by green border.");
doc.save(base.artifactsDir + "Border.FontBorder.docx");
Shows how to insert a paragraph with a top border.
let doc = new aw.Document();
let builder = new aw.DocumentBuilder(doc);
let topBorder = builder.paragraphFormat.borders.top;
topBorder.lineWidth = 4.0;
topBorder.lineStyle = aw.LineStyle.DashSmallGap;
// Set ThemeColor only when LineWidth or LineStyle setted.
topBorder.themeColor = aw.Themes.ThemeColor.Accent1;
topBorder.tintAndShade = 0.25;
builder.writeln("Text with a top border.");
doc.save(base.artifactsDir + "Border.ParagraphTopBorder.docx");
See Also
- module Aspose.Words
- class InternableComplexAttr