API Reference
ConvertFrom-OfficeImage
Exports a recognized image as editable Excel, Word, text, Markdown, HTML, JSON, CSV or searchable PDF.
Remarks
Recognize once with Get-OfficeImageDocument, inspect its evidence, then reuse that snapshot for each output. Excel and CSV contain detected tables only. CSV requires exactly one table. Empty recognition or missing tables fail before output publication.
Examples
Export an image as Excel and Word.
PS>
$image = Get-OfficeImageDocument -Path .\Ledger.png
$image | ConvertFrom-OfficeImage -OutputPath .\Ledger.xlsx -FirstRowIsHeader -PassThru
$image | ConvertFrom-OfficeImage -OutputPath .\Ledger.docx
Excel receives caller-confirmed headers and typed columns. PassThru returns recognition evidence and the format conversion report.
Customize CSV formatting while retaining formula escaping.
PS>
$csv = @{ Delimiter = ';'; FormulaInjectionPolicy = 'Escape' }
$image | ConvertFrom-OfficeImage -OutputPath .\Ledger.csv -CsvOptions $csv
Set Escape explicitly when customizing CSV formatting for spreadsheet consumption. Every recognized table row is written as data without a synthesized header, regardless of IncludeHeader.
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.
Syntax
ConvertFrom-OfficeImage [-CsvOptions <CsvSaveOptions>] [-ExcelOptions <PdfTablesToExcelOptions>] [-FirstRowIsHeader] [-Force] [-HtmlOptions <PdfToHtmlOptions>] -InputObject <PdfSearchableOcrReview> -OutputPath <String> [-PassThru] [-WordOptions <PdfToWordOptions>] [<CommonParameters>]#All Parameter SetsParameters
- CsvOptions CsvSaveOptions
- CSV field formatting and formula policy. When omitted, formula-like source text is escaped, including negative numeric text. Supplied options retain their FormulaInjectionPolicy; a new CsvSaveOptions object defaults to Preserve. Set Escape explicitly when customizing options for spreadsheet consumption. Every recognized table row is written as data without a synthesized header, regardless of IncludeHeader. This command controls UTF-8, uncompressed file output and replacement through Force; CsvOptions controls field formatting and formula handling.
- ExcelOptions PdfTablesToExcelOptions
- Advanced Excel typing, culture, row limit and table formatting settings.
- FirstRowIsHeader SwitchParameter
- Confirm the first row of each Excel table with unknown schema as column headers.
- Force SwitchParameter
- Replace an existing destination after conversion succeeds.
- HtmlOptions PdfToHtmlOptions
- Advanced HTML projection settings. Word and HTML defaults exclude the original scan from editable content.
- InputObject PdfSearchableOcrReview
- Recognized image review returned by Get-OfficeImageDocument.
- OutputPath String
- Output path. The extension selects .xlsx, .docx, .pdf, .txt, .md, .html, .json or .csv.
- PassThru SwitchParameter
- Return output location, source review and format report instead of FileInfo.
- WordOptions PdfToWordOptions
- Advanced Word projection settings.
Outputs
PSWriteOffice.Services.Ocr.OfficeImageConversionResult: Output location, recognition evidence and format projection report from an image export.