Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Test-OfficePdfAccessibility

Module
PSWriteOffice
Inputs
OfficeIMO.Pdf.PdfDocument System.String[]
Outputs
OfficeIMO.Pdf.PdfAccessibilityReport

Checks a PDF against PDF/UA-1 using the Matterhorn Protocol failure conditions.

Syntax

Test-OfficePdfAccessibility
[-IgnorePermissionRestrictions]
[-LoadOptions <PdfLoadOptions>]
[-Password <SecureString>]
[-Path] <String[]>
[<CommonParameters>]
#
Parameter set: Path
Test-OfficePdfAccessibility
-Document <PdfDocument>
[<CommonParameters>]
#
Parameter set: Document
Test-OfficePdfAccessibility
[-IgnorePermissionRestrictions]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
[-Password <SecureString>]
[<CommonParameters>]
#
Parameter set: LiteralPath

Description

Works on any PDF, including files OfficeIMO did not produce. Machine-checkable conditions are evaluated; conditions that need a person's judgement are returned with status NeedsReview and are never reported as passed.

Automatic coverage is not complete: conditions not checked yet, such as the glyph-level font checks, are returned with status NotChecked, and when the document permissions deny accessibility extraction most conditions are Indeterminate. No failures therefore does not mean the file conforms; see the PDF accessibility support matrix in the OfficeIMO documentation for the coverage of each condition.

Examples

List the failed accessibility conditions of a PDF.

$report = Test-OfficePdfAccessibility -Path .\Report.pdf
$report.FailedConditions | Select-Object @{ n = 'Condition'; e = { $_.Condition.ConditionId } }, OccurrenceCount

Returns the accessibility report; Findings carry page, object and structure-element locations.

Show where each failure is.

(Test-OfficePdfAccessibility -Path .\Report.pdf).Findings |
                Where-Object Severity -eq 'Error' |
                Format-Table ConditionId, PageNumber, ObjectNumber, StructureType, Message

Lists the failing objects with the Matterhorn condition they break.

Parameters

-IgnorePermissionRestrictions SwitchParameter optionalsets: Path, LiteralPath
After successful password authentication, explicitly ignore owner-imposed usage restrictions.
-LoadOptions PdfLoadOptions optionalsets: Path, LiteralPath
Native input loading policy.
-Password SecureString optionalsets: Path, LiteralPath
Password used to open a Standard password-encrypted PDF.
-Path String[] requiredposition: 0sets: Path
PDF file paths to check; wildcards are expanded.
-Document PdfDocument requiredpipeline: True (ByValue)sets: Document
PDF document to check.
-LiteralPath String[] requiredpipeline: True (ByPropertyName)aliases: FullName, PSPathsets: LiteralPath
Literal PDF file paths to check.

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.