Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Add-OfficePdfHeading

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

Adds a heading to a PDF document.

Syntax

Add-OfficePdfHeading
[-Alignment <OfficeAlignment>]
[-Bookmark <String>]
[-Color <OfficeColor>]
[-Level <Int32>]
[-Text] <String>
[<CommonParameters>]
#
Parameter set: Context
Add-OfficePdfHeading
[-Alignment <OfficeAlignment>]
[-Bookmark <String>]
[-Color <OfficeColor>]
-Document <PdfDocument>
[-Level <Int32>]
[-PassThru]
[-Text] <String>
[<CommonParameters>]
#
Parameter set: Document

Examples

Create heading levels in a PDF report.

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.

Parameters

-Alignment OfficeAlignment optional
Heading alignment.
Possible values: Left, Center, Right, Justify, Start, End
-Bookmark String optional
Bookmark destination attached to the heading.
-Color OfficeColor optional
Optional heading color. Named colors and hexadecimal values are accepted.
-Level Int32 optional
Heading level, 1 through 3.
-Text String requiredposition: 0
Heading text.
-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.