Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

Stars 654
Forks 82
Open issues 1
Total downloads 4,320,051
Release OfficeIMO-v3.5.3
Language: C# Updated: 2026-11-03
Cmdlet

Read-OfficePdf

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

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

Syntax

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

Examples

Read paragraphs and tables from a PDF.

$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.

Parameters

-IgnorePermissionRestrictions SwitchParameter optionalsets: Path
After successful password authentication, explicitly ignore owner-imposed usage restrictions.
-Options PdfReadOptions optional
Advanced structured-read settings. Friendly parameters override the corresponding setting when explicitly supplied.
-PageRange String optional
Optional page ranges such as 1-3,5.
-Password String optionalsets: Path
Password used to open a Standard password-encrypted PDF.
-Path String requiredposition: 0pipeline: True (ByValue)aliases: FilePathsets: Path
PDF file path.
-Profile PdfReadProfile optional
Semantic reconstruction profile. Structured is the default; Fast omits optional document-wide enrichment.
Possible values: Fast, Structured
-Document PdfDocument requiredpipeline: True (ByValue)sets: Document
An existing OfficeIMO.Pdf document, such as output from Get-OfficePdf.

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.