Test-OfficePdfAccessibility
Checks a PDF against PDF/UA-1 using the Matterhorn Protocol failure conditions.
Syntax
Test-OfficePdfAccessibility
[-IgnorePermissionRestrictions]
[-LoadOptions <PdfLoadOptions>]
[-Password <SecureString>]
[-Path] <String[]>
[<CommonParameters>]#PathTest-OfficePdfAccessibility
-Document <PdfDocument>
[<CommonParameters>]#DocumentTest-OfficePdfAccessibility
[-IgnorePermissionRestrictions]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
[-Password <SecureString>]
[<CommonParameters>]#LiteralPathDescription
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 } }, OccurrenceCountReturns 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, MessageLists the failing objects with the Matterhorn condition they break.
Parameters
- -IgnorePermissionRestrictions SwitchParameter
- After successful password authentication, explicitly ignore owner-imposed usage restrictions.
- -LoadOptions PdfLoadOptions
- Native input loading policy.
- -Password SecureString
- Password used to open a Standard password-encrypted PDF.
- -Path String[]
- PDF file paths to check; wildcards are expanded.
- -Document PdfDocument
- PDF document to check.
- -LiteralPath String[]
- 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.