Export (0) Print
Expand All

LeftBorder class

Left Paragraph Border. When the object is serialized out as xml, its qualified name is w:left.

Namespace:  DocumentFormat.OpenXml.Wordprocessing
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

public class LeftBorder : BorderType

[ISO/IEC 29500-1 1st Edition]

left (Left Paragraph Border)

This element specifies the border which shall be displayed on the left side of the page around the specified paragraph. This shall not change based on the paragraph direction.

To determine if any two adjoining paragraphs should have a left border which spans the full line height or not, the left border shall be drawn between the top border or between border at the top (whichever would be rendered for the current paragraph), and the bottom border or between border at the bottom (whichever would be rendered for the current paragraph).

If this element is omitted on a given paragraph, its value is determined by the setting previously set at any level of the style hierarchy (i.e. that previous setting remains unchanged). If this setting is never specified in the style hierarchy, then no left border shall be applied.

[Example: Consider the following two paragraphs' WordprocessingML definition:

<w:p>
  <w:pPr>
    <w:pBdr>
      <w:top w:val="single" w:sz="24" w:space="1" w:color="F2DCDB" w:themeColor="accent2" w:themeTint="33" /> 
      <w:left w:val="single" w:sz="24" w:space="4" w:color="B97034" w:themeColor="accent6" w:themeShade="BF" /> 
      <w:bottom w:val="single" w:sz="24" w:space="1" w:color="F2DCDB" w:themeColor="accent2" w:themeTint="33" /> 
      <w:right w:val="single" w:sz="24" w:space="4" w:color="C3D69B" w:themeColor="accent3" w:themeTint="99" /> 
      <w:between w:val="single" w:sz="24" w:space="1" w:color="4F81BD" w:themeColor="accent1" /> 
    </w:pBdr>
  </w:pPr>
  <w:r>
    <w:t>First paragraph.</w:t> 
  </w:r>
</w:p>
<w:p>
  <w:pPr>
    <w:pBdr>
      <w:top w:val="single" w:sz="24" w:space="1" w:color="F2DCDB" w:themeColor="accent2" w:themeTint="33" /> 
      <w:left w:val="single" w:sz="24" w:space="4" w:color="B97034" w:themeColor="accent6" w:themeShade="BF" /> 
      <w:bottom w:val="single" w:sz="24" w:space="1" w:color="F2DCDB" w:themeColor="accent2" w:themeTint="33" /> 
      <w:right w:val="single" w:sz="24" w:space="4" w:color="C3D69B" w:themeColor="accent3" w:themeTint="99" /> 
      <w:between w:val="single" w:sz="24" w:space="1" w:color="4F81BD" w:themeColor="accent1" /> 
    </w:pBdr>
  </w:pPr>
  <w:r>
    <w:t>Second paragraph.</w:t> 
  </w:r>
</w:p>

Since the paragraph border set is identical between the two paragraphs, the paragraphs are connected by a between border. These paragraphs therefore draw the left border between the top and between borders for the first paragraph, and the between and bottom borders for the second paragraph. end example]

Parent Elements

pBdr (§17.3.1.24)

This element’s content model is defined by the common border properties definition in §17.3.4.

[ISO/IEC 29500-1 1st Edition]

left (Left Border)

This element specifies the presentation and display of the page border displayed at the left of each page in this section.

[Example: Consider a section in which all pages have a left border consisting of a repeated image of an umbrella, like this:

This border would result in the following WordprocessingML:

<w:sectPr>
  …  <w:pgBorders>
    <w:left w:val="seattle" …/>
  </w:pgBorders>
  …</w:sectPr>

Because the page only has a border at the left, only the left element is specified within the set of page borders. end example]

When a document has a left border that is relative to the page edges (using the offsetFrom attribute value of page on pgBorders), it shall span the left edge of the page at the location defined by its properties, stopping when:

  • It intersects with the corresponding top or bottom page border (if one is specified).

  • It reaches the edge of the page.

[Example: In the example above, no top or bottom border was specified in the WordprocessingML, so a consumer must draw the border from one edge of the page to the other. end example]

When a document has a left border that is relative to the text (using the offsetFrom attribute value of text on pgBorders), it shall span only the necessary width to satisfy the requirement of spanning the width of the text.

When a document has custom border art specified by the id attribute, it shall use the corresponding relationship part item as an image for the left border. If the corresponding relationship part item cannot be located, the consumer shall use the border specified by the value of the val attribute. If the corresponding value of the val attribute cannot be resolved, no left border is present when the page is displayed.

Parent Elements

pgBorders (§17.6.10)

Attributes

Description

color (Border Color)

Specifies the color for this border.

This value can be defined as either:

  • A color value using the color model whose red, green, and blue values are written as numbers in the range 0 to 255, hex encoded, and concatenated. [Example: Full intensity red would be 255 red, 0 green, 0 blue, encoded to FF, 00, 00, and concatenated to FF0000. end example] . colors are specified in the sRGB color space.

  • auto to allow a consumer to automatically determine the border color in order to make the document's text readable. [Example: A document with white text and a background color of auto might result in the use of a black background, in order to ensure legibility of the content. end example]

[Example: Consider a border color with value auto, as follows:

<w:bottom … w:color="auto"/>

This color therefore can be automatically be modified by a consumer as appropriate, for example, in order to ensure that the border can be distinguished against the page's background color. end example]

If the border style (the val attribute) specifies the use of an art border, this attribute is ignored. As well, if the border specifies the use of a theme color via the themeColor attribute, this value is superseded by the theme color value.

The possible values for this attribute are defined by the ST_HexColor simple type (§17.18.38).

frame (Create Frame Effect)

Specifies whether the specified border should be modified to create a frame effect by reversing the border's appearance from the edge nearest the text to the edge furthest from the text.

If this attribute is omitted, then the border is not given any frame effect.

[Example: Consider a bottom border which must appear with a frame effect, which is specified in the following WordprocessingML:

<w:bottom w:frame="true" … />

This frame's val is true, indicating that the border frame effect must be applied. end example]

The possible values for this attribute are defined by the ST_OnOff simple type (§22.9.2.7).

id (Custom Defined Border Relationship Reference)

Namespace: .../officeDocument/2006/relationships

Specifies the relationship ID for the relationship which contains the custom border image for the parent element. This custom border image is contained in a separate part within the WordprocessingML package.

The relationship explicitly targeted by this attribute shall be of type http://schemas.openxmlformats.org/officeDocument/2006/relationships/image or the document shall be considered non-conformant.

If this attribute is omitted, then no custom border shall be used.

[Example: Consider the following WordprocessingML markup for a custom bottom border in a document:

<w:bottom w:val="custom" r:id="rIdCustomBottomBorder" …/>

The id attribute in the relationship reference namespace specifies that the relationship with relationship ID rIdCustomBottomBorder must contain the custom bottom border image for the document. end example]

The possible values for this attribute are defined by the ST_RelationshipId simple type (§22.8.2.1).

shadow (Border Shadow)

Specifies whether this border should be modified to create the appearance of a shadow.

For the right and bottom borders, this is accomplished by duplicating the border below and right of the normal border location. For the right and top borders, this is accomplished by moving the order down and to the right of its original location.

If this attribute is omitted, then the border is not given the shadow effect.

[Example: Consider a top border which must appear with a shadow effect, resulting in the following WordprocessingML:

<w:bottom w:shadow="true" … />

This frame's val is true, indicating that the shadow effect must be applied to the border. end example]

The possible values for this attribute are defined by the ST_OnOff simple type (§22.9.2.7).

space (Border Spacing Measurement)

Specifies the spacing offset that shall be used to place this border on the parent object.

When a document has a page border that is relative to the page edges (using a value of page in the offsetFrom attribute on pgBorders (§17.6.10)), it shall specify the distance between the edge of the page and the beginning of this border in points.

When a document has a page border that is relative to the text extents (using a value of text in the offsetFrom attribute on pgBorders (§17.6.10)), or any other border type, it shall specify the distance between the edge of the object and the beginning of this border in points.

[Example: Consider a document with a set of page borders all specified to appear 24 points from the edge of the page. The resulting WordprocessingML would be as follows:

<w:pgBorders w:offsetFrom="page">
  <w:bottom … w:space="24" /> 
</w:pgBorders

The offsetFrom attribute specifies that the space value provides the offset of the page border from the page edge, and the value of the space attribute specifies that the page offset must be 24 points. end example]

The possible values for this attribute are defined by the ST_PointMeasure simple type (§17.18.68).

sz (Border Width)

Specifies the width of the current border.

If the border style (val attribute) specifies a line border, the width of this border is specified in measurements of eighths of a point, with a minimum value of two (one-fourth of a point) and a maximum value of 96 (twelve points). Any values outside this range can be reassigned to a more appropriate value.

If the border style (val attribute) specifies an art border, the width of this border is specified in measurements of points, with a minimum value of one and a maximum value of 31. Any values outside this range can be reassigned to a more appropriate value.

[Example: Consider a document with a three point wide dashed line border on all sides, resulting in the following WordprocessingML markup:

<w:top w:val="dashed" w:sz="24" …/>
<w:left w:val="dashed" w:sz="24" …/>
<w:bottom w:val="dashed" w:sz="24" …/>
<w:right w:val="dashed" w:sz="24" …/>

The border style is specified using the val attribute, and because that border style is a line border (dashed), the sz attribute specifies the size in eighths of a point (24 eighths of a point = 3 points). end example]

The possible values for this attribute are defined by the ST_EighthPointMeasure simple type (§17.18.23).

themeColor (Border Theme Color)

Specifies the base theme color used to generate the border color. The border color is the value associated with themeColor as further transformed by themeTint or themeShade (if one is present), else the background color is the value associated with themeColor.

The specified theme color is a reference to one of the predefined theme colors, located in the document's Theme part (§14.2.7 and §20.1.6.9), which allows color information to be set centrally in the document.

To determine the color to display, the following actions are performed:

  • Using the mapping specified in the ST_ThemeColor simple type (§17.18.97), the appropriate attribute on the clrSchemeMapping element (§17.15.1.20) is read.

  • Using that value and the mapping specified in the ST_ColorSchemeIndex simple type (§17.18.103), the appropriate element in the document’s Theme part is read to get the base theme color.

  • The specified color is modified based on the presence of the themeTint or themeShade attribute.

[Example: Consider a set of borders configured to use the accent2 theme color, resulting in the following WordprocessingML markup:

<w:top … w:themeColor="accent2" w:themeTint="99" />
<w:bottom … w:themeColor="accent2" w:themeTint="99" />
<w:left … w:themeColor="accent2" w:themeTint="99" />
<w:right … w:themeColor="accent2" w:themeTint="99" />

If the Settings part contained the following markup:

<w:clrSchemeMapping … w:accent2="accent2"/>

and the Theme part contained the following XML markup:

<a:accent2>
  <a:srgbClr val="4F81BD"/>
</a:accent2>

the resulting border color would be 95B3D7 (the result of a 60% tint applied to the original theme color; see the calculations in themeTint below for details). end example]

The possible values for this attribute are defined by the ST_ThemeColor simple type (§17.18.97).

themeShade (Border Theme Color Shade)

Specifies the shade value applied to the supplied theme color (if any) for this border instance. If the themeColor attribute is not present, then this attribute shall not be used.

If the themeShade is supplied, then it is applied to the value of the theme color (from the theme part) to determine the final color applied to this border.

The themeShade value is stored as a hex encoding of the shade value (from 0–255) applied to the current border.

[Example: Consider a shade of 40% applied to a border in a document. This shade is calculated as follows:

The resulting themeShade value in the file format would be 66. end example]

Given an color defined as three hex values in RRGGBB format, the shade is applied as follows:

  • Convert the color to the HSL color format (values from 0 to 1)

  • Modify the luminance factor as follows:

  • Convert the resultant HSL color to

[Example: Consider a document with a background using the accent2 theme color, whose value (in RRGGBB hex format) is C0504D.

The equivalent HSL color value would be.

Applying the shade formula with a shade percentage of 75% to the luminance, we get:

Taking the resulting HSL color value of and converting back to , we get 943634.

This transformed value can be seen in the resulting background's color attribute:

<w:top w:val="single" w:sz="4" w:space="24"   w:color="943634" w:themeColor="accent2"   w:themeShade="BF"/>

end example]

The possible values for this attribute are defined by the ST_UcharHexNumber simple type (§17.18.98).

themeTint (Border Theme Color Tint)

Specifies the tint value applied to the supplied theme color (if any) for this border instance. If the themeColor attribute is not present, then this attribute shall not be used.

If the themeTint is supplied, then it is applied to the value of the theme color (from the theme part) to determine the final color applied to this border.

The themeTint value is stored as a hex encoding of the tint value (from 0–255) applied to the current border.

[Example: Consider a tint of 60% applied to a border in a document. This tint is calculated as follows:

The resulting themeTint value in the file format would be 99. end example]

Given an color defined as three hex values in RRGGBB format, the shade is applied as follows:

  • Convert the color to the HSL color format (values from 0 to 1)

  • Modify the luminance factor as follows:

  • Convert the resultant HSL color to

[Example: Consider a document with a background using the accent2 theme color, whose value (in RRGGBB hex format) is 4F81BD.

The equivalent HSL color value would be.

Applying the tint formula with a tint percentage of 60% to the luminance, we get:

Taking the resulting HSL color value of and converting back to , we get 95B3D7.

This transformed value can be seen in the resulting background's color attribute:

<w:top w:val="single" w:sz="4" w:space="24"  w:color="95B3D7" w:themeColor="accent2"   w:themeTint="99"/>

end example]

The possible values for this attribute are defined by the ST_UcharHexNumber simple type (§17.18.98).

val (Border Style)

Specifies the style of border used on this object.

This border can either be an art border (a repeated image along the borders - shall only be used for page borders) or a line border (a line format repeated along the borders) - see the simple type definition for a description of each border style.

[Example: Consider a left border resulting in the following WordprocessingML:

<w:left w:val="single" …/>

This border's val is single, indicating that the border style is a single line. end example]

The possible values for this attribute are defined by the ST_Border simple type (§17.18.2).

[Note: The W3C XML Schema definition of this element’s content model (CT_PageBorder) is located in §A.1. end note]

[ISO/IEC 29500-1 1st Edition]

left (Left Border for HTML div)

This element specifies the border which shall be displayed at the left of the boundaries of the current HTML div object.

If this element is omitted, then this HTML div object shall not have a left border.

[Example: Consider a simple HTML document defined as follows:

<html>
  <body>
    <div style=" border-left-style:solid; border-right-style:groove; border-right-width:1px; border-top-style:dashed; border-top-width:3px; border-bottom-style:outset; border-bottom-width:3px">
      <p>paragraph of text</p>
    </div>
  </body>
</html>

This HTML would therefore normally appear as follows (image scaled appropriately):

Now, when this document is saved in the WordprocessingML format, the information stored on the div elements is stored in the web setting part as follows:

<w:divs>
  <w:div w:id="1785730240">
     …    <w:divBdr>
      <w:top w:val="dashed" w:sz="18" w:space="7" w:color="auto" />
      <w:left w:val="single" w:sz="24" w:space="4" w:color="auto" />
      <w:bottom w:val="outset" w:sz="18" w:color="auto" />
      <w:right w:val="threeDEngrave" w:sz="6" w:color="auto" />
    </w:divBdr>
  </w:div>
</w:divs>

The left element specifies border information about the left border for the single HTML div structure in the document; in this case, a 3 point bottom border of type single. The initial 4 pixel border was converted to 3 points using the following logic:

end example]

Parent Elements

divBdr (§17.15.2.7)

This element’s content model is defined by the common border properties definition in §17.3.4.

[ISO/IEC 29500-1 1st Edition]

left (Table Cell Leading Edge Border)

This element is semantically equivalent to start (Part 1, §17.4.34), specified above.

For tables which have the bidiVisual property (Part 1, §17.4.1) applied, this border is applied to the right edge of the cell.

Parent Elements

tcBorders (Part 1, §17.4.67)

This element’s content model is defined by the common border properties definition in Part 1, §17.3.4.

[ISO/IEC 29500-1 1st Edition]

left (Table Leading Edge Border)

This element is semantically equivalent to start (Part 1, §17.4.37), specified above.

For tables which have the bidiVisual property (Part 1, §17.4.1) applied, this border is applied to the right edge of the table.

Parent Elements

tblBorders (Part 1, §17.4.39); tblBorders (Part 1, §17.4.40)

This element’s content model is defined by the common border properties definition in Part 1, §17.3.4.

© ISO/IEC29500: 2008.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

Show:
© 2014 Microsoft