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