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

Read-OfficePdf

Namespace PSWriteOffice
Inputs
OfficeIMO.Pdf.PdfDocument System.String
Outputs
OfficeIMO.Pdf.PdfDocumentReadResult

Reads a PDF into OfficeIMO.Pdf's canonical structured document model.

Remarks

Reads a PDF into OfficeIMO.Pdf's canonical structured document model.

Examples

Authored help example

Read paragraphs and tables from a PDF.

PS>


$logical = Read-OfficePdf -Path .\Examples\Documents\Report.pdf -Profile Structured
            foreach ($page in $logical.Pages) {
                $page.Paragraphs | ForEach-Object { $_.Text }
                $page.Tables | Select-Object @{ Name = 'Page'; Expression = { $page.PageNumber } }, @{ Name = 'Rows'; Expression = { $_.Rows.Count } }
            }
        

Returns the canonical OfficeIMO.Pdf result, including typed pages, paragraphs, tables, images, and diagnostics.

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

Read-OfficePdf [-IgnorePermissionRestrictions] [-Options <PdfReadOptions>] [-PageRange <String>] [-Password <String>] -Path <String> [-Profile <Fast|Structured>] [<CommonParameters>]
#
Parameter set: Path

Parameters

IgnorePermissionRestrictions SwitchParameter optionalposition: namedpipeline: False
After successful password authentication, explicitly ignore owner-imposed usage restrictions.
Options PdfReadOptions optionalposition: namedpipeline: False
Advanced structured-read settings. Friendly parameters override the corresponding setting when explicitly supplied.
PageRange String optionalposition: namedpipeline: False
Optional page ranges such as 1-3,5.
Password String optionalposition: namedpipeline: False
Password used to open a Standard password-encrypted PDF.
Path String requiredposition: 0pipeline: True (ByValue)aliases: FilePath
PDF file path.
Profile PdfReadProfile optionalposition: namedpipeline: Falsevalues: 2
Semantic reconstruction profile. Structured is the default; Fast omits optional document-wide enrichment.
Possible values: Fast, Structured

Outputs

OfficeIMO.Pdf.PdfDocumentReadResult

Read-OfficePdf -Document <PdfDocument> [-Options <PdfReadOptions>] [-PageRange <String>] [-Profile <Fast|Structured>] [<CommonParameters>]
#
Parameter set: Document

Parameters

Document PdfDocument requiredposition: namedpipeline: True (ByValue)
An existing OfficeIMO.Pdf document, such as output from Get-OfficePdf.
Options PdfReadOptions optionalposition: namedpipeline: False
Advanced structured-read settings. Friendly parameters override the corresponding setting when explicitly supplied.
PageRange String optionalposition: namedpipeline: False
Optional page ranges such as 1-3,5.
Profile PdfReadProfile optionalposition: namedpipeline: Falsevalues: 2
Semantic reconstruction profile. Structured is the default; Fast omits optional document-wide enrichment.
Possible values: Fast, Structured

Outputs

OfficeIMO.Pdf.PdfDocumentReadResult