Project

PSWriteOffice

PowerShell document automation across Word, Excel, PowerPoint, PDF, Reader, Confluence, Visio, and open text formats.

Stars 159
Forks 14
PowerShell Gallery downloads 158,661
Release v3.0.5
Language: C# Updated: 2026-09-03

API Reference

Cmdlet

Add-OfficePdfHeading

Aliases: PdfHeading
Namespace PSWriteOffice
Aliases
PdfHeading
Inputs
OfficeIMO.Pdf.PdfDocument
Outputs
OfficeIMO.Pdf.PdfDocument

Adds a heading to a PDF document.

Remarks

Adds a heading to a PDF document.

Examples

Authored help example

Create heading levels in a PDF report.

PS>


New-OfficePdf -Path .\Examples\Documents\PdfHeadings.pdf {
                Add-OfficePdfHeading -Text 'Service Review' -Level 1 -Color '#1D4ED8'
                Add-OfficePdfHeading -Text 'Open risks' -Level 2
                Add-OfficePdfParagraph -Text 'Heading levels create the report structure.'
              }
        

Adds report headings before body content.

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.

Syntax

Add-OfficePdfHeading [-Align <Left|Center|Right|Justify>] [-Color <String>] [-Level <Int32>] [-PassThru] -Text <String> [<CommonParameters>]
#
Parameter set: Context

Parameters

Align PdfAlign optionalposition: namedpipeline: Falsevalues: 4
Heading alignment.
Possible values: Left, Center, Right, Justify
Color String optionalposition: namedpipeline: False
Optional heading color. Named colors and hexadecimal values are accepted.
Level Int32 optionalposition: namedpipeline: False
Heading level, 1 through 3.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the updated document.
Text String requiredposition: 0pipeline: False
Heading text.

Outputs

OfficeIMO.Pdf.PdfDocument

Add-OfficePdfHeading [-Align <Left|Center|Right|Justify>] [-Color <String>] -Document <PdfDocument> [-Level <Int32>] [-PassThru] -Text <String> [<CommonParameters>]
#
Parameter set: Document

Parameters

Align PdfAlign optionalposition: namedpipeline: Falsevalues: 4
Heading alignment.
Possible values: Left, Center, Right, Justify
Color String optionalposition: namedpipeline: False
Optional heading color. Named colors and hexadecimal values are accepted.
Document PdfDocument requiredposition: namedpipeline: True (ByValue)
PDF document to update outside the DSL context.
Level Int32 optionalposition: namedpipeline: False
Heading level, 1 through 3.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the updated document.
Text String requiredposition: 0pipeline: False
Heading text.

Outputs

OfficeIMO.Pdf.PdfDocument