Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Export-OfficeHtmlImage

Module PSWriteOffice
Inputs
OfficeIMO.Html.HtmlConversionDocument System.String
Outputs
OfficeIMO.Drawing.OfficeImageExportResult

Exports an HTML render surface as PNG or SVG with structured diagnostics.

Syntax

Export-OfficeHtmlImage [-DocumentOptions <HtmlConversionDocumentOptions>] [-Format <OfficeImageExportFormat>] [-OutputPath] <String> [-PageIndex <Int32>] [-PassThru] [-Path] <String> [-RenderOptions <HtmlRenderOptions>] [<CommonParameters>]
#
Parameter set: Path
Export-OfficeHtmlImage [-DocumentOptions <HtmlConversionDocumentOptions>] [-Format <OfficeImageExportFormat>] -Html <String> [-OutputPath] <String> [-PageIndex <Int32>] [-PassThru] [-RenderOptions <HtmlRenderOptions>] [<CommonParameters>]
#
Parameter set: Html
Export-OfficeHtmlImage -Document <HtmlConversionDocument> [-DocumentOptions <HtmlConversionDocumentOptions>] [-Format <OfficeImageExportFormat>] [-OutputPath] <String> [-PageIndex <Int32>] [-PassThru] [-RenderOptions <HtmlRenderOptions>] [<CommonParameters>]
#
Parameter set: Document

Examples

Authored help example

Render an HTML file to PNG.

Export-OfficeHtmlImage -Path .\Report.html -OutputPath .\Report.png

Uses the dependency-free OfficeIMO HTML renderer. Add -PassThru to receive the structured export result.

Parameters

-DocumentOptions HtmlConversionDocumentOptions optional
Optional HTML parsing and trust settings for path or markup input.
-Format OfficeImageExportFormat optional
Output image format.
Possible values: Png, Svg, Jpeg, Tiff, Webp, Bmp, Pbm, Tga, Icon
-OutputPath String requiredposition: 1
Destination PNG, JPEG, TIFF, SVG, or WebP path.
-PageIndex Int32 optional
Zero-based rendered page index.
-PassThru SwitchParameter optional
Emit the structured image export result.
-Path String requiredposition: 0sets: Path
Path to an HTML file.
-RenderOptions HtmlRenderOptions optional
Optional size, pagination, resource, and rendering settings.
-Html String requiredpipeline: True (ByValue)sets: Html
HTML markup to render.
-Document HtmlConversionDocument requiredpipeline: True (ByValue)sets: Document
Shared HTML conversion document.

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.