Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

ConvertTo-OfficeDocumentImage

Module
PSWriteOffice
Inputs
System.Object System.String System.String[]
Outputs
OfficeIMO.Drawing.OfficeImageExportResult

Renders native pages, slides, sheets, ranges or charts to image results without writing files.

Syntax

ConvertTo-OfficeDocumentImage
[-BackgroundColor <OfficeColor>]
[-Chart <String>]
[-Dpi <Double>]
[-Format <OfficeImageFormat>]
[-Options <Object[]>]
[-Page <OfficePageRange>]
[-Password <SecureString>]
[-Path] <String[]>
[-Range <String>]
[-Scale <Double>]
[-Sheet <OfficeSheetSelector[]>]
[-ThrottleLimit <Int32>]
[<CommonParameters>]
#
Parameter set: Path
ConvertTo-OfficeDocumentImage
[-BackgroundColor <OfficeColor>]
[-Chart <String>]
[-Dpi <Double>]
[-Format <OfficeImageFormat>]
-LiteralPath <String[]>
[-Options <Object[]>]
[-Page <OfficePageRange>]
[-Password <SecureString>]
[-Range <String>]
[-Scale <Double>]
[-Sheet <OfficeSheetSelector[]>]
[-ThrottleLimit <Int32>]
[<CommonParameters>]
#
Parameter set: LiteralPath
ConvertTo-OfficeDocumentImage
[-BackgroundColor <OfficeColor>]
[-Chart <String>]
[-Document] <Object>
[-Dpi <Double>]
[-Format <OfficeImageFormat>]
[-Options <Object[]>]
[-Page <OfficePageRange>]
[-Password <SecureString>]
[-Range <String>]
[-Scale <Double>]
[-Sheet <OfficeSheetSelector[]>]
[<CommonParameters>]
#
Parameter set: Document
ConvertTo-OfficeDocumentImage
[-BackgroundColor <OfficeColor>]
[-Chart <String>]
[-Dpi <Double>]
[-Format <OfficeImageFormat>]
-From <String>
[-Options <Object[]>]
[-Page <OfficePageRange>]
[-Password <SecureString>]
[-Range <String>]
[-Scale <Double>]
[-Sheet <OfficeSheetSelector[]>]
[-Text] <String>
[<CommonParameters>]
#
Parameter set: Text

Examples

Render selected slides in memory.

ConvertTo-OfficeDocumentImage -Path ./review.pptx -Page 1-3 -Format Svg | Select-Object Name, Width, Height

Render HTML markup.

ConvertTo-OfficeDocumentImage -Text '<h1>Service status</h1>' -From Html

Parameters

-BackgroundColor OfficeColor optional
Image background, including Transparent.
-Chart String optional
Chart name within the selected Excel sheets. Cannot be combined with Range.
-Dpi Double optional
Target image resolution in dots per inch; omitted values retain native options.
-Format OfficeImageFormat optional
Output image encoding. File destinations infer it when omitted.
Possible values: Unknown, Png, Jpeg, Gif, Bmp, Tiff, Svg, Emf, Wmf, Icon, Pcx, Webp, Jpeg2000, Jpeg2000Codestream, Avif, JpegXr, PortableMap, Tga, Heic
-Options Object[] optional
Native image/load options or hashtables, routed to the selected source formats.
-Page OfficePageRange optional
One-based caller-ordered pages, slides or diagram pages; defaults to all.
-Password SecureString optional
Password used only when opening encrypted source files.
-Path String[] requiredposition: 0pipeline: True (ByValue)sets: Path
Input paths, with FileSystem wildcard expansion.
-Range String optional
A1 range within the selected Excel sheets.
-Scale Double optional
Image scale; omitted values retain native options.
-Sheet OfficeSheetSelector[] optional
Excel worksheets selected by name, one-based position or native sheet object.
-ThrottleLimit Int32 optionalsets: Path, LiteralPath
Maximum number of input files processed concurrently.
-LiteralPath String[] requiredpipeline: True (ByPropertyName)aliases: FullName, PSPathsets: LiteralPath
Literal paths; accepts FileInfo, PSPath and FullName properties.
-Document Object requiredposition: 0pipeline: True (ByValue)sets: Document
Caller-owned native document, including current unsaved content.
-From String requiredsets: Text
Markup source format; use Html.
-Text String requiredposition: 0pipeline: True (ByValue)sets: Text
Literal HTML markup.

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.