Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

New-OfficeExcelImageOptions

Module
PSWriteOffice
Inputs
None

Creates Excel rendering settings for Export-OfficeDocumentImage and ConvertTo-OfficeDocumentImage.

Syntax

New-OfficeExcelImageOptions
[-ChartFidelity <Strict|BestEffort>]
[-IncludeCharts]
[-IncludeConditionalFormatting]
[-IncludeDrawingObjects]
[-IncludeHidden]
[-IncludeHiddenSheets]
[-IncludeImages]
[-MaximumDegreeOfParallelism <Int32>]
[-MaximumOutputCount <Int32>]
[-MaximumOutputHeight <Int32>]
[-MaximumOutputWidth <Int32>]
[-MaximumRasterPixelCount <Int64>]
[-MaximumRenderedCells <Int32>]
[-MaximumTotalEncodedBytes <Int64>]
[-MaximumTotalRasterPixelCount <Int64>]
[-RasterOverflowBehavior <ReduceScale|Throw>]
[-RenderTimeoutSeconds <Double>]
[-ShowCommentBodies]
[-ShowGridlines]
[-ShowHyperlinkHints]
[-SplitWorksheetsByManualPageBreaks]
[-TextShapingLanguage <String>]
[-UseWorksheetPrintAreas]
[<CommonParameters>]
#
Parameter set: Default

Examples

Render a sheet with gridlines

$image = New-OfficeExcelImageOptions -ShowGridlines
Export-OfficeDocumentImage -Path .\Reports\Q3-Sales.xlsx -Sheet Summary -OutputPath .\Images\Q3-Summary.png -Options $image

Renders the Summary sheet to PNG with gridlines shown.

Render dashboard sheets for a status page

$image = New-OfficeExcelImageOptions -IncludeCharts -IncludeImages -IncludeConditionalFormatting
Export-OfficeDocumentImage -Path .\Reports\Operations.xlsx -Sheet Dashboard -OutputDirectory .\Site\Images -Scale 2 -Options $image

Renders the dashboard at double scale with charts and images, so the PNG stays sharp when embedded in a web page.

Parameters

-ChartFidelity OfficeChartFidelity optional
Chart handling: Strict (default) skips charts with formatting that cannot be drawn exactly; BestEffort draws the closest approximation and reports chart-approximation warnings.
Possible values: Strict, BestEffort
-IncludeCharts SwitchParameter optional
Includes charts in the rendered output; explicit false omits them.
-IncludeConditionalFormatting SwitchParameter optional
Evaluates supported conditional formatting during rendering; explicit false disables it.
-IncludeDrawingObjects SwitchParameter optional
Includes worksheet drawing objects in the rendered output.
-IncludeHidden SwitchParameter optional
Renders hidden rows and columns; explicit false omits them.
-IncludeHiddenSheets SwitchParameter optional
Includes hidden worksheets when no explicit sheet selection is supplied.
-IncludeImages SwitchParameter optional
Includes embedded worksheet images in the rendered output.
-MaximumDegreeOfParallelism Int32 optional
Maximum concurrent render workers; omission retains the native limit.
-MaximumOutputCount Int32 optional
Maximum number of images produced by one batch operation.
-MaximumOutputHeight Int32 optional
Maximum output height in pixels.
-MaximumOutputWidth Int32 optional
Maximum output width in pixels.
-MaximumRasterPixelCount Int64 optional
Maximum pixel count allocated for one raster image.
-MaximumRenderedCells Int32 optional
Maximum worksheet cells materialized for one visual snapshot.
-MaximumTotalEncodedBytes Int64 optional
Maximum aggregate encoded image bytes in one batch.
-MaximumTotalRasterPixelCount Int64 optional
Maximum aggregate raster pixels in one batch.
-RasterOverflowBehavior OfficeRasterOverflowBehavior optional
Native policy when the requested raster exceeds its pixel budget.
Possible values: ReduceScale, Throw
-RenderTimeoutSeconds Double optional
Render timeout in seconds; omission retains the native timeout.
-ShowCommentBodies SwitchParameter optional
Renders comment text rather than only comment indicators.
-ShowGridlines SwitchParameter optional
Renders worksheet gridlines; explicit false hides them.
-ShowHyperlinkHints SwitchParameter optional
Renders hyperlink hints in worksheet snapshots.
-SplitWorksheetsByManualPageBreaks SwitchParameter optional
Creates separate images at worksheet manual page breaks.
-TextShapingLanguage String optional
Language tag used for native text shaping.
-UseWorksheetPrintAreas SwitchParameter optional
Honor worksheet print areas.

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.