Click or drag to resize

BorderStyle Enumeration

Specifies line style for a border.

Namespace:  GemBox.Document
Assembly:  GemBox.Document (in GemBox.Document.dll) Version:
public enum BorderStyle
  Member nameValueDescription
None0 No border.
Single1 Single line border.
Double2 Double line border.
Triple3 Triple line border.
Dotted4 Dotted line border.
Dashed5 Dashed line border.
DotDash6 Dot - dash line border.
DotDotDash7 Dot - dot - dash line border.
Wave8 Wave line border.
DoubleWave9 Double wave line border.
Outset10 Outset set of line borders.
Inset11 Inset set of line borders.
DashSmallGap12 Dash with small gap line borders.
ThickThinLargeGap13 Thick - thin with large gap line borders.
ThickThinMediumGap14 Thick - thin with medium gap line borders.
ThickThinSmallGap15 Thick - thin with small gap line borders.
ThinThickLargeGap16 Thin - thick with large gap line borders.
ThinThickMediumGap17 Thin - thick with medium gap line borders.
ThinThickSmallGap18 Thin - thick with small gap line borders.
ThinThickThinLargeGap19 Thin - thick - thin with large gap line borders.
ThinThickThinMediumGap20 Thin - thick - thin with medium gap line borders.
ThinThickThinSmallGap21 Thin - thick - thin with small gap line borders.
DashDotStroked22 Dash - dot stroked line border.
Emboss3D23 3D embossed line border.
Engrave3D24 3D engraved line border.

BorderStyle is specified when creating a new SingleBorder and assigning it to a CharacterFormat.Border property, or when setting a multiple borders through SetBorders(MultipleBorderTypes, BorderStyle, Color, Double) on ParagraphFormat.Borders, TableFormat.Borders or TableCellFormat.Borders properties.

Supported values in PDF, XPS and image file formats:

  • Single
  • Double
  • Dotted
  • Dashed
  • DashSmallGap
  • DotDash
  • DotDotDash

Following example shows how to create a document that demonstrates all available border styles.

// Get all border styles.
var borderStyles = (BorderStyle[])Enum.GetValues(typeof(BorderStyle));

// Create a new empty document.
var doc = new DocumentModel();

// Insert a table with 1 column and 'borderStyles.Length' rows.
    new Section(doc, 
        new Table(doc, borderStyles.Length, 1, (row, column) =>
            // Create a new table cell with text taken from 'borderStyles' array at index 'row'.
            var cell = new TableCell(doc, new Paragraph(doc, borderStyles[row].ToString()));

            // Set cell outside borders to red color, with width of 2 points and with border style taken from 'borderStyles' array at index 'row'.
            cell.CellFormat.Borders.SetBorders(MultipleBorderTypes.Outside, borderStyles[row], Color.Red, 2d);

            return cell;

// Document will be saved to the Desktop.
var path = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "Borders.docx");

// Save the document.

// Open the document in Microsoft Word.
See Also