# Compare-OfficePdfVisual

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

Project

PSWriteOffice

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

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **727**

Forks **84**

Open issues **7**

Total downloads **5,275,783**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-24

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`None`

**Outputs**

`OfficeIMO.Pdf.PdfVisualComparisonReport`

**Source**

[CompareOfficePdfVisualCommand.cs:17](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Pdf/CompareOfficePdfVisualCommand.cs#L17) 

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>]
```

[#](#method-compare-officepdfvisual-string-string-pdfloadoptions-switchparameter-switchparameter-pdfvisualcomparisonoptions-string-string-string-pdfloadoptions)

Parameter set: `All Parameter Sets`

## Examples

### Compare selected pages with a small pixel tolerance.

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

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:962090041F74683CD028E0888D5015491F16467C5F43196F96E7AFCEC6660B37 -->
