Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

New-OfficePdfReadOptions

Module
PSWriteOffice
Inputs
None
Outputs
PSWriteOffice.Models.Pdf.PdfReadOptions

Creates a detached native PDF read policy and optional OCR-review settings.

Syntax

New-OfficePdfReadOptions
[-IgnorePermissionRestrictions]
[-LayoutOptions <PdfTextLayoutOptions>]
[-LoadOptions <PdfLoadOptions>]
[-OcrMergeOptions <PdfOcrMergeOptions>]
[-Page <OfficePageRange>]
[-Password <SecureString>]
[-Profile <Fast|Structured>]
[<CommonParameters>]
#
Parameter set: Default

Examples

Read selected pages with bounded untrusted-input parsing.

$options = New-OfficePdfReadOptions -LoadOptions ([OfficeIMO.Pdf.PdfLoadOptions]::UntrustedDefaults) -Profile Fast -Page '2-4'
Read-OfficeDocument -Path ./Report.pdf -Options $options -As Text

Limit rasterization before an explicitly requested OCR review.

$ocr = New-OfficeOcrOptions -NoLanguageDownload
$options = New-OfficePdfReadOptions -OcrMergeOptions @{ MaxPixelsPerPage = 2000000; Dpi = 96 }
Read-OfficeDocument -Path ./Scan.pdf -Options $options -As Ocr -OcrOptions $ocr

Parameters

-IgnorePermissionRestrictions SwitchParameter optional
Ignore permission restrictions after successful decryption; explicit false restores enforcement.
-LayoutOptions PdfTextLayoutOptions optional
Native layout and reading-order settings.
-LoadOptions PdfLoadOptions optional
Complete base policy, including strict parsing and resource ceilings.
-OcrMergeOptions PdfOcrMergeOptions optional
Native OCR-review settings, used by Read-OfficeDocument -As Ocr.
-Page OfficePageRange optional
Caller-ordered one-based source pages.
-Password SecureString optional
Password used to open encrypted PDFs; omission preserves the base policy.
-Profile PdfReadProfile optional
Semantic reconstruction profile; omission preserves the base policy.
Possible values: Fast, Structured

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.

Outputs

PSWriteOffice.Models.Pdf.PdfReadOptions: OCR settings apply to Read-OfficeDocument -As Ocr. The native policies remain available for direct engine calls.