Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

Stars 654
Forks 82
Open issues 1
Total downloads 4,320,051
Release OfficeIMO-v3.5.3
Language: C# Updated: 2026-11-03
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

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.