Project

PSWriteOffice

PowerShell document automation across Word, Excel, PowerPoint, PDF, Reader, Confluence, Visio, and open text formats.

Stars 161
Forks 15
PowerShell Gallery downloads 158,661
Release v3.0.7
Language: C# Updated: 2026-09-19

API Reference

Cmdlet

ConvertTo-OfficePdfSearchable

Namespace PSWriteOffice
Inputs
System.String
Outputs
System.IO.FileInfo OfficeIMO.Pdf.Ocr.PdfSearchableOcrResult

Creates a searchable PDF by adding invisible text from a discovered local OCR runtime.

Remarks

Creates a searchable PDF by adding invisible text from a discovered local OCR runtime.

Examples

Authored help example

Make a scanned PDF searchable.

PS>


ConvertTo-OfficePdfSearchable -Path .\Scan.pdf -OutputPath .\Scan-Searchable.pdf
        

Preserves visible page content and writes geometry-aligned invisible English text.

Recognize an English and Polish document and inspect the OCR evidence.

PS>


ConvertTo-OfficePdfSearchable -Path .\Scan.pdf -OutputPath .\Searchable.pdf -Language English, Polish -PassThru
        

Returns recognition, filtering, page, provider, and model evidence instead of the output file.

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

ConvertTo-OfficePdfSearchable [-Force] [-Language <English>] [-MinimumConfidence <Double>] [-NoLanguageDownload] [-Options <TesseractOcrSessionOptions>] -OutputPath <String> [-PassThru] -Path <String> [-PdfOptions <PdfOcrMergeOptions>] [-RenderDpi <Double>] [-TessdataDirectory <String>] [-TesseractLanguageExpression <String>] [-TesseractPath <String>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

Force SwitchParameter optionalposition: namedpipeline: False
Overwrite an existing destination file.
Language TesseractOcrLanguage[] optionalposition: namedpipeline: Falsevalues: 28
Friendly OCR languages. Supply more than one value to recognize multilingual content.
Possible values: English, Polish, Arabic, ChineseSimplified, ChineseTraditional, Czech, Danish, Dutch, Finnish, French, German, Greek, Hebrew, Hindi, Hungarian, Italian, Japanese, Korean, Norwegian, Portuguese, Romanian, Russian, Slovak, Spanish, Swedish, Turkish, Ukrainian, Vietnamese
MinimumConfidence Double optionalposition: namedpipeline: False
Minimum normalized confidence accepted for searchable text.
NoLanguageDownload SwitchParameter optionalposition: namedpipeline: False
Do not download checksum-pinned curated language data when a requested language is missing.
Options TesseractOcrSessionOptions optionalposition: namedpipeline: False
Advanced OfficeIMO OCR options. Convenience parameters override matching values.
OutputPath String requiredposition: 1pipeline: False
Destination PDF path.
PassThru SwitchParameter optionalposition: namedpipeline: False
Return the complete searchable-PDF OCR result instead of the output file.
Path String requiredposition: 0pipeline: True (ByValue)aliases: FilePath
Source PDF path.
PdfOptions PdfOcrMergeOptions optionalposition: namedpipeline: False
Advanced PDF page selection, rendering, confidence, overlap, and resource limits.
RenderDpi Double optionalposition: namedpipeline: False
PDF page render resolution used for recognition.
TessdataDirectory String optionalposition: namedpipeline: False
Explicit directory containing Tesseract trained-data files.
TesseractLanguageExpression String optionalposition: namedpipeline: False
Advanced raw Tesseract expression for caller-installed custom trained-data models.
TesseractPath String optionalposition: namedpipeline: False
Explicit Tesseract executable path. By default OfficeIMO securely discovers an installed runtime.

Outputs

System.IO.FileInfo, OfficeIMO.Pdf.Ocr.PdfSearchableOcrResult