# Add-OfficePdfHorizontalRule

Adds a horizontal rule divider to a generated PDF document.

Cmdlet 

Aliases: PdfHorizontalRule

**Module**

`PSWriteOffice`

**Aliases**

`PdfHorizontalRule`

**Inputs**

`OfficeIMO.Pdf.PdfDocument`

**Outputs**

`OfficeIMO.Pdf.PdfDocument`

**Source**

[AddOfficePdfHorizontalRuleCommand.cs:23](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/Pdf/AddOfficePdfHorizontalRuleCommand.cs#L23) 

Adds a horizontal rule divider to a generated PDF document.

## Syntax

```
Add-OfficePdfHorizontalRule
[-Color <OfficeColor>]
[-SpacingAfter <OfficeLength>]
[-SpacingBefore <OfficeLength>]
[-Thickness <OfficeLength>]
[<CommonParameters>]
```

[#](#method-add-officepdfhorizontalrule-officecolor-officelength-officelength-officelength)

Parameter set: `Context`

```
Add-OfficePdfHorizontalRule
[-Color <OfficeColor>]
-Document <PdfDocument>
[-PassThru]
[-SpacingAfter <OfficeLength>]
[-SpacingBefore <OfficeLength>]
[-Thickness <OfficeLength>]
[<CommonParameters>]
```

[#](#method-add-officepdfhorizontalrule-officecolor-pdfdocument-switchparameter-officelength-officelength-officelength)

Parameter set: `Document`

## Examples

### Separate report sections with a divider.

```powershell
New-OfficePdf -Path .\Examples\Documents\PdfDivider.pdf {
  Add-OfficePdfHeading -Text 'Executive summary'
  Add-OfficePdfParagraph -Text 'The service is healthy.'
  Add-OfficePdfHorizontalRule -Color '#CBD5E1' -Thickness 0.75 -SpacingBefore 10 -SpacingAfter 10
  Add-OfficePdfHeading -Text 'Signals' -Level 2
}
```

Adds a visual divider between generated PDF sections.

## Parameters

**-Color OfficeColor optional**

Rule color. Named colors and hexadecimal values are accepted.

**-SpacingAfter OfficeLength optional**

Spacing after the rule in PDF points.

**-SpacingBefore OfficeLength optional**

Spacing before the rule in PDF points.

**-Thickness OfficeLength optional**

Rule thickness in PDF points.

**-Document PdfDocument requiredpipeline: True (ByValue)sets: Document**

PDF document to update outside the DSL context.

**-PassThru SwitchParameter optionalsets: Document**

Emit the updated document.

## Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see [about_CommonParameters](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

<!-- PowerForge markdown artifact sha256:3165FCE8C4D87995848A932832806BF9426AE6167CE2ABF1FC744ABC27C0FA3F -->
