API Reference

Cmdlet

Add-OfficePdfTable

Aliases: PdfTable
Namespace PSWriteOffice
Aliases
PdfTable
Inputs
OfficeIMO.Pdf.PdfDocument System.Object
Outputs
OfficeIMO.Pdf.PdfDocument

Adds a table to a PDF document.

Remarks

Adds a table to a PDF document.

Examples

Authored help example

Add object data as a PDF table.

PS>


$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.

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-OfficePdfTable [-Align <Left|Center|Right|Justify>] [-AutoFitColumns] [-BorderColor <String>] [-BorderWidth <Nullable`1>] [-Caption <String>] [-CaptionAlign <Nullable`1>] [-CaptionColor <String>] [-CaptionFontSize <Nullable`1>] [-CellPaddingX <Nullable`1>] [-CellPaddingY <Nullable`1>] [-ColumnAlign <Left|Center|Right>] [-ColumnWidthPoints <Double[]>] [-ColumnWidthWeights <Double[]>] [-FontSize <Nullable`1>] [-FooterRowCount <Nullable`1>] [-Header <String[]>] [-HeaderFill <String>] [-HeaderFontSize <Nullable`1>] [-HeaderRowCount <Nullable`1>] [-HeaderTextColor <String>] -InputObject <Object> [-KeepTogether] [-KeepWithNext] [-LineHeight <Nullable`1>] [-MinimumShrinkFontSize <Nullable`1>] [-NoBorder] [-NoHeaderFill] [-NoRowStripeFill] [-PassThru] [-Property <String[]>] [-RepeatHeaderRowCount <Nullable`1>] [-RightAlignNumeric] [-RowStripeFill <String>] [-ShrinkTextToFit] [-SpacingAfter <Nullable`1>] [-SpacingBefore <Nullable`1>] [-TableStyle <String>] [-TextColor <String>] [-View <Normal|Transpose>] [<CommonParameters>]
#
Parameter set: Context

Parameters

Align PdfAlign optionalposition: namedpipeline: Falsevalues: 4
Table alignment.
Possible values: Left, Center, Right, Justify
AutoFitColumns SwitchParameter optionalposition: namedpipeline: False
Measure flexible columns from content.
BorderColor String optionalposition: namedpipeline: False
Border color in #RRGGBB format.
BorderWidth Nullable`1 optionalposition: namedpipeline: False
Border width in PDF points.
Caption String optionalposition: namedpipeline: False
Caption rendered above the table grid.
CaptionAlign Nullable`1 optionalposition: namedpipeline: False
Caption alignment.
CaptionColor String optionalposition: namedpipeline: False
Caption color in #RRGGBB format.
CaptionFontSize Nullable`1 optionalposition: namedpipeline: False
Caption font size in PDF points.
CellPaddingX Nullable`1 optionalposition: namedpipeline: False
Horizontal cell padding in PDF points.
CellPaddingY Nullable`1 optionalposition: namedpipeline: False
Vertical cell padding in PDF points.
ColumnAlign PdfColumnAlign[] optionalposition: namedpipeline: Falsevalues: 3
Per-column horizontal alignment.
Possible values: Left, Center, Right
ColumnWidthPoints Double[] optionalposition: namedpipeline: False
Fixed column widths in PDF points.
ColumnWidthWeights Double[] optionalposition: namedpipeline: False
Relative column width weights.
FontSize Nullable`1 optionalposition: namedpipeline: False
Body cell font size in PDF points.
FooterRowCount Nullable`1 optionalposition: namedpipeline: False
Number of trailing rows rendered as footer rows.
Header String[] optionalposition: namedpipeline: False
Header labels. Defaults to property names.
HeaderFill String optionalposition: namedpipeline: False
Header fill color in #RRGGBB format.
HeaderFontSize Nullable`1 optionalposition: namedpipeline: False
Header cell font size in PDF points.
HeaderRowCount Nullable`1 optionalposition: namedpipeline: False
Number of leading rows rendered as header rows.
HeaderTextColor String optionalposition: namedpipeline: False
Header text color in #RRGGBB format.
InputObject Object requiredposition: 0pipeline: True (ByValue)
Objects or row arrays to render as a table.
KeepTogether SwitchParameter optionalposition: namedpipeline: False
Keep the table together when possible.
KeepWithNext SwitchParameter optionalposition: namedpipeline: False
Keep the table with the next block when possible.
LineHeight Nullable`1 optionalposition: namedpipeline: False
Wrapped line height multiplier for table cells.
MinimumShrinkFontSize Nullable`1 optionalposition: namedpipeline: False
Smallest font size, in points, used by -ShrinkTextToFit.
NoBorder SwitchParameter optionalposition: namedpipeline: False
Hide table borders.
NoHeaderFill SwitchParameter optionalposition: namedpipeline: False
Disable the header fill.
NoRowStripeFill SwitchParameter optionalposition: namedpipeline: False
Disable alternating row fill.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the updated document.
Property String[] optionalposition: namedpipeline: False
Specific object properties to include.
RepeatHeaderRowCount Nullable`1 optionalposition: namedpipeline: False
Number of leading header rows repeated on following pages.
RightAlignNumeric SwitchParameter optionalposition: namedpipeline: False
Right-align numeric-looking cell values.
RowStripeFill String optionalposition: namedpipeline: False
Alternating body row fill color in #RRGGBB format.
ShrinkTextToFit SwitchParameter optionalposition: namedpipeline: False
Reduce table text size when needed so cell text fits within the resolved cell width.
SpacingAfter Nullable`1 optionalposition: namedpipeline: False
Spacing after the table in PDF points.
SpacingBefore Nullable`1 optionalposition: namedpipeline: False
Spacing before the table in PDF points.
TableStyle String optionalposition: namedpipeline: False
OfficeIMO table style preset or supported Word table style name.
TextColor String optionalposition: namedpipeline: False
Body text color in #RRGGBB format.
View OfficeTableView optionalposition: namedpipeline: Falsevalues: 2
Projection to apply before writing the table.
Possible values: Normal, Transpose

Outputs

OfficeIMO.Pdf.PdfDocument

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

Parameters

Align PdfAlign optionalposition: namedpipeline: Falsevalues: 4
Table alignment.
Possible values: Left, Center, Right, Justify
AutoFitColumns SwitchParameter optionalposition: namedpipeline: False
Measure flexible columns from content.
BorderColor String optionalposition: namedpipeline: False
Border color in #RRGGBB format.
BorderWidth Nullable`1 optionalposition: namedpipeline: False
Border width in PDF points.
Caption String optionalposition: namedpipeline: False
Caption rendered above the table grid.
CaptionAlign Nullable`1 optionalposition: namedpipeline: False
Caption alignment.
CaptionColor String optionalposition: namedpipeline: False
Caption color in #RRGGBB format.
CaptionFontSize Nullable`1 optionalposition: namedpipeline: False
Caption font size in PDF points.
CellPaddingX Nullable`1 optionalposition: namedpipeline: False
Horizontal cell padding in PDF points.
CellPaddingY Nullable`1 optionalposition: namedpipeline: False
Vertical cell padding in PDF points.
ColumnAlign PdfColumnAlign[] optionalposition: namedpipeline: Falsevalues: 3
Per-column horizontal alignment.
Possible values: Left, Center, Right
ColumnWidthPoints Double[] optionalposition: namedpipeline: False
Fixed column widths in PDF points.
ColumnWidthWeights Double[] optionalposition: namedpipeline: False
Relative column width weights.
Document PdfDocument requiredposition: namedpipeline: True (ByValue)
PDF document to update outside the DSL context.
FontSize Nullable`1 optionalposition: namedpipeline: False
Body cell font size in PDF points.
FooterRowCount Nullable`1 optionalposition: namedpipeline: False
Number of trailing rows rendered as footer rows.
Header String[] optionalposition: namedpipeline: False
Header labels. Defaults to property names.
HeaderFill String optionalposition: namedpipeline: False
Header fill color in #RRGGBB format.
HeaderFontSize Nullable`1 optionalposition: namedpipeline: False
Header cell font size in PDF points.
HeaderRowCount Nullable`1 optionalposition: namedpipeline: False
Number of leading rows rendered as header rows.
HeaderTextColor String optionalposition: namedpipeline: False
Header text color in #RRGGBB format.
InputObject Object requiredposition: 0pipeline: True (ByValue)
Objects or row arrays to render as a table.
KeepTogether SwitchParameter optionalposition: namedpipeline: False
Keep the table together when possible.
KeepWithNext SwitchParameter optionalposition: namedpipeline: False
Keep the table with the next block when possible.
LineHeight Nullable`1 optionalposition: namedpipeline: False
Wrapped line height multiplier for table cells.
MinimumShrinkFontSize Nullable`1 optionalposition: namedpipeline: False
Smallest font size, in points, used by -ShrinkTextToFit.
NoBorder SwitchParameter optionalposition: namedpipeline: False
Hide table borders.
NoHeaderFill SwitchParameter optionalposition: namedpipeline: False
Disable the header fill.
NoRowStripeFill SwitchParameter optionalposition: namedpipeline: False
Disable alternating row fill.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the updated document.
Property String[] optionalposition: namedpipeline: False
Specific object properties to include.
RepeatHeaderRowCount Nullable`1 optionalposition: namedpipeline: False
Number of leading header rows repeated on following pages.
RightAlignNumeric SwitchParameter optionalposition: namedpipeline: False
Right-align numeric-looking cell values.
RowStripeFill String optionalposition: namedpipeline: False
Alternating body row fill color in #RRGGBB format.
ShrinkTextToFit SwitchParameter optionalposition: namedpipeline: False
Reduce table text size when needed so cell text fits within the resolved cell width.
SpacingAfter Nullable`1 optionalposition: namedpipeline: False
Spacing after the table in PDF points.
SpacingBefore Nullable`1 optionalposition: namedpipeline: False
Spacing before the table in PDF points.
TableStyle String optionalposition: namedpipeline: False
OfficeIMO table style preset or supported Word table style name.
TextColor String optionalposition: namedpipeline: False
Body text color in #RRGGBB format.
View OfficeTableView optionalposition: namedpipeline: Falsevalues: 2
Projection to apply before writing the table.
Possible values: Normal, Transpose

Outputs

OfficeIMO.Pdf.PdfDocument

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

Parameters

Align PdfAlign optionalposition: namedpipeline: Falsevalues: 4
Table alignment.
Possible values: Left, Center, Right, Justify
AutoFitColumns SwitchParameter optionalposition: namedpipeline: False
Measure flexible columns from content.
BorderColor String optionalposition: namedpipeline: False
Border color in #RRGGBB format.
BorderWidth Nullable`1 optionalposition: namedpipeline: False
Border width in PDF points.
Caption String optionalposition: namedpipeline: False
Caption rendered above the table grid.
CaptionAlign Nullable`1 optionalposition: namedpipeline: False
Caption alignment.
CaptionColor String optionalposition: namedpipeline: False
Caption color in #RRGGBB format.
CaptionFontSize Nullable`1 optionalposition: namedpipeline: False
Caption font size in PDF points.
CellPaddingX Nullable`1 optionalposition: namedpipeline: False
Horizontal cell padding in PDF points.
CellPaddingY Nullable`1 optionalposition: namedpipeline: False
Vertical cell padding in PDF points.
ColumnAlign PdfColumnAlign[] optionalposition: namedpipeline: Falsevalues: 3
Per-column horizontal alignment.
Possible values: Left, Center, Right
ColumnWidthPoints Double[] optionalposition: namedpipeline: False
Fixed column widths in PDF points.
ColumnWidthWeights Double[] optionalposition: namedpipeline: False
Relative column width weights.
Document PdfDocument requiredposition: namedpipeline: True (ByValue)
PDF document to update outside the DSL context.
FontSize Nullable`1 optionalposition: namedpipeline: False
Body cell font size in PDF points.
FooterRowCount Nullable`1 optionalposition: namedpipeline: False
Number of trailing rows rendered as footer rows.
Header String[] optionalposition: namedpipeline: False
Header labels. Defaults to property names.
HeaderFill String optionalposition: namedpipeline: False
Header fill color in #RRGGBB format.
HeaderFontSize Nullable`1 optionalposition: namedpipeline: False
Header cell font size in PDF points.
HeaderRowCount Nullable`1 optionalposition: namedpipeline: False
Number of leading rows rendered as header rows.
HeaderTextColor String optionalposition: namedpipeline: False
Header text color in #RRGGBB format.
InputObject Object requiredposition: 0pipeline: True (ByValue)
Objects or row arrays to render as a table.
KeepTogether SwitchParameter optionalposition: namedpipeline: False
Keep the table together when possible.
KeepWithNext SwitchParameter optionalposition: namedpipeline: False
Keep the table with the next block when possible.
LineHeight Nullable`1 optionalposition: namedpipeline: False
Wrapped line height multiplier for table cells.
MinimumShrinkFontSize Nullable`1 optionalposition: namedpipeline: False
Smallest font size, in points, used by -ShrinkTextToFit.
NoBorder SwitchParameter optionalposition: namedpipeline: False
Hide table borders.
NoHeaderFill SwitchParameter optionalposition: namedpipeline: False
Disable the header fill.
NoRowStripeFill SwitchParameter optionalposition: namedpipeline: False
Disable alternating row fill.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the updated document.
Property String[] optionalposition: namedpipeline: False
Specific object properties to include.
RepeatHeaderRowCount Nullable`1 optionalposition: namedpipeline: False
Number of leading header rows repeated on following pages.
RightAlignNumeric SwitchParameter optionalposition: namedpipeline: False
Right-align numeric-looking cell values.
RowStripeFill String optionalposition: namedpipeline: False
Alternating body row fill color in #RRGGBB format.
ShrinkTextToFit SwitchParameter optionalposition: namedpipeline: False
Reduce table text size when needed so cell text fits within the resolved cell width.
SpacingAfter Nullable`1 optionalposition: namedpipeline: False
Spacing after the table in PDF points.
SpacingBefore Nullable`1 optionalposition: namedpipeline: False
Spacing before the table in PDF points.
TableStyle String optionalposition: namedpipeline: False
OfficeIMO table style preset or supported Word table style name.
TextColor String optionalposition: namedpipeline: False
Body text color in #RRGGBB format.
View OfficeTableView optionalposition: namedpipeline: Falsevalues: 2
Projection to apply before writing the table.
Possible values: Normal, Transpose

Outputs

OfficeIMO.Pdf.PdfDocument