Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Compare-OfficePdfVisual

Module PSWriteOffice
Inputs
None
Outputs
OfficeIMO.Pdf.PdfVisualComparisonReport

Compares rendered PDF pages and returns pixel-level review artifacts.

Syntax

Compare-OfficePdfVisual [-DifferencePassword <String>] [-DifferencePath] <String> [-DifferenceReadOptions <PdfLoadOptions>] [-IgnoreDifferencePermissionRestrictions] [-IgnoreReferencePermissionRestrictions] [-Options <PdfVisualComparisonOptions>] [-PageRange <String>] [-ReferencePassword <String>] [-ReferencePath] <String> [-ReferenceReadOptions <PdfLoadOptions>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Examples

Authored help example

Compare selected pages with a small pixel tolerance.

$options = New-OfficePdfVisualComparisonOptions -AllowedDifferenceRatio 0.001 -ChannelTolerance 2
Compare-OfficePdfVisual -ReferencePath .\Expected.pdf -DifferencePath .\Actual.pdf -PageRange '1-3' -Options $options

Returns per-page difference ratios, images, and diagnostics.

Parameters

-DifferencePassword String optional
Password used to authenticate the actual PDF.
-DifferencePath String requiredposition: 1
Actual PDF path.
-DifferenceReadOptions PdfLoadOptions optional
Optional bounded read settings for the actual document.
-IgnoreDifferencePermissionRestrictions SwitchParameter optional
After authentication, explicitly ignore restrictions on the actual PDF.
-IgnoreReferencePermissionRestrictions SwitchParameter optional
After authentication, explicitly ignore restrictions on the expected PDF.
-Options PdfVisualComparisonOptions optional
Optional render, tolerance, alignment, background, and ignored regions.
-PageRange String optional
Optional one-based ranges such as 1-3,5.
-ReferencePassword String optional
Password used to authenticate the expected PDF.
-ReferencePath String requiredposition: 0
Expected PDF path.
-ReferenceReadOptions PdfLoadOptions optional
Optional bounded read settings for the expected document.

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.