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 <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>]#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 Double
- Border width in PDF points.
- Caption String
- Caption rendered above the table grid.
- CaptionAlign PdfAlign
- Caption alignment.
- Possible values:
Left,Center,Right,Justify - CaptionColor String
- Caption color in #RRGGBB format.
- CaptionFontSize Double
- Caption font size in PDF points.
- CellPaddingX Double
- Horizontal cell padding in PDF points.
- CellPaddingY Double
- Vertical cell padding in PDF points.
- CollectionSeparator String
- Text used between items when a property or cell contains a collection.
- 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.
- DictionaryEntrySeparator String
- Text used between entries when a cell contains a dictionary.
- DictionaryKeyValueSeparator String
- Text used between a dictionary key and value.
- FontSize Double
- Body cell font size in PDF points.
- FooterRowCount Int32
- 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 Double
- Header cell font size in PDF points.
- HeaderRowCount Int32
- 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 Double
- Wrapped line height multiplier for table cells.
- MaxCollectionItems Int32
- 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
- Maximum nesting depth allowed while normalizing one cell value. Defaults to 64; increase explicitly for trusted deeper values.
- MinimumShrinkFontSize Double
- 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 Int32
- 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 Double
- Spacing after the table in PDF points.
- SpacingBefore Double
- 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 <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>]#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 Double
- Border width in PDF points.
- Caption String
- Caption rendered above the table grid.
- CaptionAlign PdfAlign
- Caption alignment.
- Possible values:
Left,Center,Right,Justify - CaptionColor String
- Caption color in #RRGGBB format.
- CaptionFontSize Double
- Caption font size in PDF points.
- CellPaddingX Double
- Horizontal cell padding in PDF points.
- CellPaddingY Double
- Vertical cell padding in PDF points.
- CollectionSeparator String
- Text used between items when a property or cell contains a collection.
- 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.
- DictionaryEntrySeparator String
- Text used between entries when a cell contains a dictionary.
- DictionaryKeyValueSeparator String
- Text used between a dictionary key and value.
- Document PdfDocument
- PDF document to update outside the DSL context.
- FontSize Double
- Body cell font size in PDF points.
- FooterRowCount Int32
- 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 Double
- Header cell font size in PDF points.
- HeaderRowCount Int32
- 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 Double
- Wrapped line height multiplier for table cells.
- MaxCollectionItems Int32
- 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
- Maximum nesting depth allowed while normalizing one cell value. Defaults to 64; increase explicitly for trusted deeper values.
- MinimumShrinkFontSize Double
- 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 Int32
- 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 Double
- Spacing after the table in PDF points.
- SpacingBefore Double
- 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 <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>]#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 Double
- Border width in PDF points.
- Caption String
- Caption rendered above the table grid.
- CaptionAlign PdfAlign
- Caption alignment.
- Possible values:
Left,Center,Right,Justify - CaptionColor String
- Caption color in #RRGGBB format.
- CaptionFontSize Double
- Caption font size in PDF points.
- CellPaddingX Double
- Horizontal cell padding in PDF points.
- CellPaddingY Double
- Vertical cell padding in PDF points.
- CollectionSeparator String
- Text used between items when a property or cell contains a collection.
- 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.
- DictionaryEntrySeparator String
- Text used between entries when a cell contains a dictionary.
- DictionaryKeyValueSeparator String
- Text used between a dictionary key and value.
- Document PdfDocument
- PDF document to update outside the DSL context.
- FontSize Double
- Body cell font size in PDF points.
- FooterRowCount Int32
- 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 Double
- Header cell font size in PDF points.
- HeaderRowCount Int32
- 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 Double
- Wrapped line height multiplier for table cells.
- MaxCollectionItems Int32
- 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
- Maximum nesting depth allowed while normalizing one cell value. Defaults to 64; increase explicitly for trusted deeper values.
- MinimumShrinkFontSize Double
- 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 Int32
- 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 Double
- Spacing after the table in PDF points.
- SpacingBefore Double
- 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