# Test-OfficePdfAccessibility

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

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`OfficeIMO.Pdf.PdfDocument` `System.String[]`

**Outputs**

`OfficeIMO.Pdf.PdfAccessibilityReport`

**Source**

[TestOfficePdfAccessibilityCommand.cs:33](https://github.com/EvotecIT/OfficeIMO/blob/013c05ace7bb14e293639941ec9cf54eb5177a90/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/Pdf/TestOfficePdfAccessibilityCommand.cs#L33) 

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

## Syntax

```
Test-OfficePdfAccessibility
[-IgnorePermissionRestrictions]
[-LoadOptions <PdfLoadOptions>]
[-Password <SecureString>]
[-Path] <String[]>
[<CommonParameters>]
```

[#](#method-test-officepdfaccessibility-switchparameter-pdfloadoptions-securestring-string)

Parameter set: `Path`

```
Test-OfficePdfAccessibility
-Document <PdfDocument>
[<CommonParameters>]
```

[#](#method-test-officepdfaccessibility-pdfdocument)

Parameter set: `Document`

```
Test-OfficePdfAccessibility
[-IgnorePermissionRestrictions]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
[-Password <SecureString>]
[<CommonParameters>]
```

[#](#method-test-officepdfaccessibility-switchparameter-string-pdfloadoptions-securestring)

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.

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

```powershell
(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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

<!-- PowerForge markdown artifact sha256:A68D92530321712B75E0D2372462E1342FB7D0EBAD9EA14CCEDEB97AF7279B5D -->
