Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Export-OfficeDocumentImage

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

Renders native pages, slides, sheets, ranges or charts and saves each image atomically.

Syntax

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

Examples

Export selected slides.

Export-OfficeDocumentImage -Path ./review.pptx -Page 1-3 -Format Svg -OutputDirectory ./slides

Export exactly one worksheet range.

Export-OfficeDocumentImage -LiteralPath './budget[final].xlsx' -Sheet Dashboard -Range A1:H30 -OutputPath ./dashboard.png -NoClobber

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
-NoClobber SwitchParameter optional
Refuse to replace an existing destination image.
-Options Object[] optional
Native image/load options or hashtables, routed to the selected source formats.
-OutputDirectory String requiredposition: 1sets: Path, LiteralPath, Document, Text
Destination folder for the selected image batch.
-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, PathFile
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.
-OutputPath String requiredposition: 1sets: PathFile, LiteralPathFile, DocumentFile, TextFile
Exact single-image destination; its extension selects the default encoding.
-LiteralPath String[] requiredpipeline: True (ByPropertyName)aliases: FullName, PSPathsets: LiteralPath, LiteralPathFile
Literal paths; accepts FileInfo, PSPath and FullName properties.
-Document Object requiredposition: 0pipeline: True (ByValue)sets: Document, DocumentFile
Caller-owned native document, including current unsaved content.
-From String requiredsets: Text, TextFile
Markup source format; use Html.
-Text String requiredposition: 0pipeline: True (ByValue)sets: Text, TextFile
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.