# PdfHeadingStyle

Reusable heading style for levels 1 through 9, including typography and vertical rhythm.

Class 

`OfficeIMO.Pdf`

**Namespace**

`OfficeIMO.Pdf`

**Assembly**

`OfficeIMO.Pdf`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[PdfHeadingStyle.cs:12](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfHeadingStyle.cs#L12)

**Modifiers**

sealed

Reusable heading style for levels 1 through 9, including typography and vertical rhythm.

## Inheritance

- object
- PdfHeadingStyle

## Usage

Explore 13 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 5

- Method [PdfHeadingStyle.Clone](/api/pdf/officeimo-pdf-pdfheadingstyle/#method-clone)
- Property [PdfHeadingStyles.Level1](/api/pdf/officeimo-pdf-pdfheadingstyles/#property-level1)
- Property [PdfHeadingStyles.Level2](/api/pdf/officeimo-pdf-pdfheadingstyles/#property-level2)
- Property [PdfHeadingStyles.Level3](/api/pdf/officeimo-pdf-pdfheadingstyles/#property-level3)
- Property [PdfSectionOptions.HeadingStyle](/api/pdf/officeimo-pdf-pdfsectionoptions/#property-headingstyle)

### Accepted by parameters 8

- Method [PdfContentBuilder.AddHeading](/api/pdf/officeimo-pdf-pdfcontentbuilder/#method-addheading-string-int32-officeimo-officealignment-nullable-officeimo-officecolor-string-officeimo-pdf-pdfheadingstyle-string-string) parameter `style`
- Method [PdfContentBuilder.H1](/api/pdf/officeimo-pdf-pdfcontentbuilder/#method-h1-string-officeimo-pdf-pdfheadingstyle-string-string-string) parameter `style`
- Method [PdfContentBuilder.H2](/api/pdf/officeimo-pdf-pdfcontentbuilder/#method-h2-string-officeimo-pdf-pdfheadingstyle-string-string-string) parameter `style`
- Method [PdfContentBuilder.H3](/api/pdf/officeimo-pdf-pdfcontentbuilder/#method-h3-string-officeimo-pdf-pdfheadingstyle-string-string-string) parameter `style`
- Method [PdfContentBuilder.Title](/api/pdf/officeimo-pdf-pdfcontentbuilder/#method-title-string-officeimo-officealignment-nullable-officeimo-officecolor-officeimo-pdf-pdfheadingstyle) parameter `style`
- Method [PdfCreateOptions.SetDefaultHeadingStyle](/api/pdf/officeimo-pdf-pdfcreateoptions/#method-setdefaultheadingstyle-int32-officeimo-pdf-pdfheadingstyle) parameter `style`
- Method [PdfDocument.AddHeading](/api/pdf/officeimo-pdf-pdfdocument/#method-addheading-string-int32-officeimo-officealignment-nullable-officeimo-officecolor-string-officeimo-pdf-pdfheadingstyle-string-string) parameter `style`
- Method [PdfPageBuilder.DefaultHeadingStyle](/api/pdf/officeimo-pdf-pdfpagebuilder/#method-defaultheadingstyle-int32-officeimo-pdf-pdfheadingstyle) parameter `style`

Filter members 

Show inherited

## Constructors

`public PdfHeadingStyle()` [#](#constructor-ctor)

[PdfHeadingStyle.cs:12](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfHeadingStyle.cs#L12)

## Methods

`public PdfTabStop AddTabStop(OfficeLength position, PdfTabAlignment alignment = Left, PdfTabLeaderStyle leader = None)` [#](#method-addtabstop-officeimo-officelength-officeimo-pdf-pdftabalignment-officeimo-pdf-pdftableaderstyle)

[PdfHeadingStyle.cs:76](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfHeadingStyle.cs#L76)

Adds a text stop or stationary bar rule at the specified finite position.

Parameters

**position OfficeIMO.OfficeLength required**

**alignment OfficeIMO.Pdf.PdfTabAlignment = Left optional**

**leader OfficeIMO.Pdf.PdfTabLeaderStyle = None optional**

Returns

`PdfTabStop`

`public void ClearTabStops()` [#](#method-cleartabstops)

[PdfHeadingStyle.cs:82](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfHeadingStyle.cs#L82)

Removes all explicit heading text stops and bar rules.

`public PdfHeadingStyle Clone()` [#](#method-clone)

[PdfHeadingStyle.cs:114](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfHeadingStyle.cs#L114)

Creates a copy of this heading style.

Returns

`PdfHeadingStyle`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public PdfLineSpacing? LineSpacing { get; set; }` [#](#property-linespacing)

[PdfHeadingStyle.cs:15](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfHeadingStyle.cs#L15)

Explicit line spacing. When set, this overrides [PdfHeadingStyle.LineHeight](/api/pdf/officeimo-pdf-pdfheadingstyle/).

`public OfficeLength? FontSize { get; set; }` [#](#property-fontsize)

[PdfHeadingStyle.cs:19](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfHeadingStyle.cs#L19)

Heading font size in points. When null the writer uses the built-in size for the heading level.

`public double? LineHeight { get; set; }` [#](#property-lineheight)

[PdfHeadingStyle.cs:28](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfHeadingStyle.cs#L28)

Line advance multiplier relative to the heading font size. When null the writer uses the built-in heading line height.

`public OfficeLength SpacingBefore { get; set; }` [#](#property-spacingbefore)

[PdfHeadingStyle.cs:37](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfHeadingStyle.cs#L37)

Vertical space before the heading, in points.

`public OfficeLength? SpacingAfter { get; set; }` [#](#property-spacingafter)

[PdfHeadingStyle.cs:46](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfHeadingStyle.cs#L46)

Vertical space after the heading, in points. When null the writer uses the built-in heading spacing.

`public OfficeColor? Color { get; set; }` [#](#property-color)

[PdfHeadingStyle.cs:54](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfHeadingStyle.cs#L54)

Heading text color. A heading block color overrides this value.

`public PdfStandardFont? Font { get; set; }` [#](#property-font)

[PdfHeadingStyle.cs:57](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfHeadingStyle.cs#L57)

Heading font slot. When null the writer uses the document default font family.

`public string? FontFamily { get; set; }` [#](#property-fontfamily)

[PdfHeadingStyle.cs:61](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfHeadingStyle.cs#L61)

Optional registered embedded family used by heading text. [PdfHeadingStyle.Font](/api/pdf/officeimo-pdf-pdfheadingstyle/) remains its fallback.

`public IList<PdfTabStop> TabStops { get; }` [#](#property-tabstops)

[PdfHeadingStyle.cs:72](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfHeadingStyle.cs#L72)

Explicit text stops and bar rules relative to the heading text frame.

`public bool Bold { get; set; }` [#](#property-bold)

[PdfHeadingStyle.cs:85](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfHeadingStyle.cs#L85)

When true, headings use the bold variant of the document font.

`public bool ApplySpacingBeforeAtTop { get; set; }` [#](#property-applyspacingbeforeattop)

[PdfHeadingStyle.cs:88](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfHeadingStyle.cs#L88)

When true, [PdfHeadingStyle.SpacingBefore](/api/pdf/officeimo-pdf-pdfheadingstyle/) is honored even when the heading starts a page or column.

`public bool KeepWithNext { get; set; }` [#](#property-keepwithnext)

[PdfHeadingStyle.cs:91](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfHeadingStyle.cs#L91)

When true, the heading moves to the next page when it would otherwise be separated from the following paragraph.

<!-- PowerForge markdown artifact sha256:D8E1723FA3091A699ACC25417F50E797DEDCBA3A08BF1C1BA7F3F6FC80CC29E6 -->
