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-OfficePdfBookmark

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

Adds a named bookmark at the current generated PDF flow position.

Remarks

Adds a named bookmark at the current generated PDF flow position.

Examples

Authored help example

Add a bookmark target and link to it.

PS>


New-OfficePdf -Path .\Examples\Documents\PdfBookmarks.pdf {
                Add-OfficePdfText -Run @(
                  @{ Text = 'Jump to details'; LinkDestinationName = 'details'; Color = '#2563EB'; Underline = $true }
                )
                Add-OfficePdfPageBreak
                Add-OfficePdfBookmark -Name 'details'
                Add-OfficePdfHeading -Text 'Details' -Level 2
              }
        

Creates an internal link target inside the generated PDF.

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-OfficePdfBookmark -Name <String> [-PassThru] [<CommonParameters>]
#
Parameter set: Context

Parameters

Name String requiredposition: 0pipeline: False
Bookmark name.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the updated document.

Outputs

OfficeIMO.Pdf.PdfDocument

Add-OfficePdfBookmark -Document <PdfDocument> -Name <String> [-PassThru] [<CommonParameters>]
#
Parameter set: Document

Parameters

Document PdfDocument requiredposition: namedpipeline: True (ByValue)
PDF document to update outside the DSL context.
Name String requiredposition: 0pipeline: False
Bookmark name.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the updated document.

Outputs

OfficeIMO.Pdf.PdfDocument