# Add-OfficePdfTable

Adds a table to a PDF document. Review available syntax, parameters, pipeline guidance, and reference details in PSWriteOffice API Reference.

Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **725**

Forks **84**

Open issues **3**

Total downloads **5,231,343**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-23

Cmdlet 

Aliases: PdfTable

**Module**

`PSWriteOffice`

**Aliases**

`PdfTable`

**Inputs**

`OfficeIMO.Pdf.PdfDocument` `System.Object`

**Outputs**

`OfficeIMO.Pdf.PdfDocument`

**Source**

[AddOfficePdfTableCommand.cs:31](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Pdf/AddOfficePdfTableCommand.cs#L31) 

Adds a table to a PDF document.

## Syntax

```
Add-OfficePdfTable
[-Align <Left|Center|Right|Justify>]
[-AutoFitColumns]
[-BorderColor <String>]
[-BorderWidth <Double>]
[-Caption <String>]
[-CaptionAlign <Left|Center|Right|Justify>]
[-CaptionColor <String>]
[-CaptionFontSize <Double>]
[-CellPaddingX <Double>]
[-CellPaddingY <Double>]
[-CollectionSeparator <String>]
[-ColumnAlign <Left|Center|Right>]
[-ColumnWidthPoints <Double[]>]
[-ColumnWidthWeights <Double[]>]
[-DictionaryEntrySeparator <String>]
[-DictionaryKeyValueSeparator <String>]
[-FontSize <Double>]
[-FooterRowCount <Int32>]
[-Header <String[]>]
[-HeaderFill <String>]
[-HeaderFontSize <Double>]
[-HeaderRowCount <Int32>]
[-HeaderTextColor <String>]
[-InputObject] <Object>
[-KeepTogether]
[-KeepWithNext]
[-LineHeight <Double>]
[-MaxCollectionItems <Int32>]
[-MaxNestingDepth <Int32>]
[-MinimumShrinkFontSize <Double>]
[-NoBorder]
[-NoHeaderFill]
[-NoRowStripeFill]
[-PassThru]
[-Property <String[]>]
[-RepeatHeaderRowCount <Int32>]
[-RightAlignNumeric]
[-RowStripeFill <String>]
[-ShrinkTextToFit]
[-SpacingAfter <Double>]
[-SpacingBefore <Double>]
[-TableStyle <String>]
[-TextColor <String>]
[-View <Normal|Transpose>]
[<CommonParameters>]
```

[#](#member-1bbb600c3e38be1ce90efde4)

Parameter set: `Context`

```
Add-OfficePdfTable
[-Align <Left|Center|Right|Justify>]
[-AutoFitColumns]
[-BorderColor <String>]
[-BorderWidth <Double>]
[-Caption <String>]
[-CaptionAlign <Left|Center|Right|Justify>]
[-CaptionColor <String>]
[-CaptionFontSize <Double>]
[-CellPaddingX <Double>]
[-CellPaddingY <Double>]
[-CollectionSeparator <String>]
[-ColumnAlign <Left|Center|Right>]
[-ColumnWidthPoints <Double[]>]
[-ColumnWidthWeights <Double[]>]
[-DictionaryEntrySeparator <String>]
[-DictionaryKeyValueSeparator <String>]
-Document <PdfDocument>
[-FontSize <Double>]
[-FooterRowCount <Int32>]
[-Header <String[]>]
[-HeaderFill <String>]
[-HeaderFontSize <Double>]
[-HeaderRowCount <Int32>]
[-HeaderTextColor <String>]
[-InputObject] <Object>
[-KeepTogether]
[-KeepWithNext]
[-LineHeight <Double>]
[-MaxCollectionItems <Int32>]
[-MaxNestingDepth <Int32>]
[-MinimumShrinkFontSize <Double>]
[-NoBorder]
[-NoHeaderFill]
[-NoRowStripeFill]
[-PassThru]
[-Property <String[]>]
[-RepeatHeaderRowCount <Int32>]
[-RightAlignNumeric]
[-RowStripeFill <String>]
[-ShrinkTextToFit]
[-SpacingAfter <Double>]
[-SpacingBefore <Double>]
[-TableStyle <String>]
[-TextColor <String>]
[-View <Normal|Transpose>]
[<CommonParameters>]
```

[#](#member-637200c1c1bb76173e80bf15)

Parameter set: `Document`

```
Add-OfficePdfTable
[-Align <Left|Center|Right|Justify>]
[-AutoFitColumns]
[-BorderColor <String>]
[-BorderWidth <Double>]
[-Caption <String>]
[-CaptionAlign <Left|Center|Right|Justify>]
[-CaptionColor <String>]
[-CaptionFontSize <Double>]
[-CellPaddingX <Double>]
[-CellPaddingY <Double>]
[-CollectionSeparator <String>]
[-ColumnAlign <Left|Center|Right>]
[-ColumnWidthPoints <Double[]>]
[-ColumnWidthWeights <Double[]>]
[-DictionaryEntrySeparator <String>]
[-DictionaryKeyValueSeparator <String>]
-Document <PdfDocument>
[-FontSize <Double>]
[-FooterRowCount <Int32>]
[-Header <String[]>]
[-HeaderFill <String>]
[-HeaderFontSize <Double>]
[-HeaderRowCount <Int32>]
[-HeaderTextColor <String>]
[-InputObject] <Object>
[-KeepTogether]
[-KeepWithNext]
[-LineHeight <Double>]
[-MaxCollectionItems <Int32>]
[-MaxNestingDepth <Int32>]
[-MinimumShrinkFontSize <Double>]
[-NoBorder]
[-NoHeaderFill]
[-NoRowStripeFill]
[-PassThru]
[-Property <String[]>]
[-RepeatHeaderRowCount <Int32>]
[-RightAlignNumeric]
[-RowStripeFill <String>]
[-ShrinkTextToFit]
[-SpacingAfter <Double>]
[-SpacingBefore <Double>]
[-TableStyle <String>]
[-TextColor <String>]
[-View <Normal|Transpose>]
[<CommonParameters>]
```

[#](#member-5984b8df8641f9579171d620)

Parameter set: `PipelineDocument`

## Examples

### Add object data as a PDF table.

```powershell
$services = @(
    [pscustomobject]@{ Name = 'Directory'; Status = 'Healthy'; Incidents = 0 }
    [pscustomobject]@{ Name = 'Mail'; Status = 'Watch'; Incidents = 2 }
)
New-OfficePdf -Path .\Examples\Documents\PdfTable.pdf {
    Add-OfficePdfHeading -Text 'Service status'
    Add-OfficePdfTable -InputObject $services -Property Name,Status,Incidents -Header 'Service','Status','Incidents'
}
```

Converts PowerShell objects into a table using selected properties and friendly headers.

## Parameters

**-Align PdfAlign optional**

Table alignment.

Possible values: `Left`, `Center`, `Right`, `Justify`

**-AutoFitColumns SwitchParameter optional**

Measure flexible columns from content.

**-BorderColor String optional**

Border color. Named colors and hexadecimal values are accepted.

**-BorderWidth Double optional**

Border width in PDF points.

**-Caption String optional**

Caption rendered above the table grid.

**-CaptionAlign PdfAlign optional**

Caption alignment.

Possible values: `Left`, `Center`, `Right`, `Justify`

**-CaptionColor String optional**

Caption color. Named colors and hexadecimal values are accepted.

**-CaptionFontSize Double optional**

Caption font size in PDF points.

**-CellPaddingX Double optional**

Horizontal cell padding in PDF points.

**-CellPaddingY Double optional**

Vertical cell padding in PDF points.

**-CollectionSeparator String optional**

Text used between items when a property or cell contains a collection.

**-ColumnAlign PdfColumnAlign[] optional**

Per-column horizontal alignment.

Possible values: `Left`, `Center`, `Right`

**-ColumnWidthPoints Double[] optional**

Fixed column widths in PDF points.

**-ColumnWidthWeights Double[] optional**

Relative column width weights.

**-DictionaryEntrySeparator String optional**

Text used between entries when a cell contains a dictionary.

**-DictionaryKeyValueSeparator String optional**

Text used between a dictionary key and value.

**-FontSize Double optional**

Body cell font size in PDF points.

**-FooterRowCount Int32 optional**

Number of trailing rows rendered as footer rows.

**-Header String[] optional**

Header labels. Defaults to property names.

**-HeaderFill String optional**

Header fill color. Named colors and hexadecimal values are accepted.

**-HeaderFontSize Double optional**

Header cell font size in PDF points.

**-HeaderRowCount Int32 optional**

Number of leading rows rendered as header rows.

**-HeaderTextColor String optional**

Header text color. Named colors and hexadecimal values are accepted.

**-InputObject Object requiredposition: 0pipeline: True (ByValue)**

Objects or row arrays to render as a table.

**-KeepTogether SwitchParameter optional**

Keep the table together when possible.

**-KeepWithNext SwitchParameter optional**

Keep the table with the next block when possible.

**-LineHeight Double optional**

Wrapped line height multiplier for table cells.

**-MaxCollectionItems Int32 optional**

Maximum number of items allowed in one nested collection or dictionary cell. Defaults to 1,048,575; increase explicitly for trusted larger values.

**-MaxNestingDepth Int32 optional**

Maximum nesting depth allowed while normalizing one cell value. Defaults to 64; increase explicitly for trusted deeper values.

**-MinimumShrinkFontSize Double optional**

Smallest font size, in points, used by -ShrinkTextToFit.

**-NoBorder SwitchParameter optional**

Hide table borders.

**-NoHeaderFill SwitchParameter optional**

Disable the header fill.

**-NoRowStripeFill SwitchParameter optional**

Disable alternating row fill.

**-PassThru SwitchParameter optional**

Emit the updated document.

**-Property String[] optional**

Specific object properties to include.

**-RepeatHeaderRowCount Int32 optional**

Number of leading header rows repeated on following pages.

**-RightAlignNumeric SwitchParameter optional**

Right-align numeric-looking cell values.

**-RowStripeFill String optional**

Alternating body row fill color. Named colors and hexadecimal values are accepted.

**-ShrinkTextToFit SwitchParameter optional**

Reduce table text size when needed so cell text fits within the resolved cell width.

**-SpacingAfter Double optional**

Spacing after the table in PDF points.

**-SpacingBefore Double optional**

Spacing before the table in PDF points.

**-TableStyle String optional**

OfficeIMO table style preset or supported Word table style name.

**-TextColor String optional**

Body text color. Named colors and hexadecimal values are accepted.

**-View OfficeTableView optional**

Projection to apply before writing the table.

Possible values: `Normal`, `Transpose`

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

PDF document to update outside the DSL context.

## 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).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:5AF3E257DA22D46AC6EFBD04697A4B38C3734DEB4F6042FAFCEFFF1A140B8EA7 -->
