Project

PSWriteOffice

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

Stars 654
Forks 82
Open issues 1
Total downloads 4,320,051
Release OfficeIMO-v3.5.3
Language: C# Updated: 2026-11-03
Cmdlet

New-OfficePdfVisualComparisonOptions

Module
PSWriteOffice
Inputs
None
Outputs
OfficeIMO.Pdf.PdfVisualComparisonOptions

Creates discoverable rendering and tolerance settings for Compare-OfficePdfVisual.

Syntax

New-OfficePdfVisualComparisonOptions
[-Alignment <TopLeft|Center>]
[-AllowedDifferenceRatio <Double>]
[-BackgroundColor <String>]
[-ChannelTolerance <Byte>]
[-MaxPages <Int32>]
[-MaxPixelsPerImage <Int64>]
[-MaxTotalOutputBytes <Int64>]
[-MaxTotalPixels <Int64>]
[-Scale <Double>]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Examples

Compare PDFs with a small rendering tolerance.

$options = New-OfficePdfVisualComparisonOptions -ChannelTolerance 2 -AllowedDifferenceRatio 0.001 -MaxPages 50
Compare-OfficePdfVisual -ReferencePath .\Expected.pdf -DifferencePath .\Actual.pdf -Options $options

Parameters

-Alignment PdfVisualPageAlignment optional
Page alignment used for differently sized renders.
Possible values: TopLeft, Center
-AllowedDifferenceRatio Double optional
Maximum differing-pixel ratio treated as equal.
-BackgroundColor String optional
Background color name or hex value.
-ChannelTolerance Byte optional
Maximum per-channel byte difference treated as equal.
-MaxPages Int32 optional
Maximum pages compared.
-MaxPixelsPerImage Int64 optional
Maximum pixels accepted per rendered image.
-MaxTotalOutputBytes Int64 optional
Maximum total bytes retained for comparison artifacts.
-MaxTotalPixels Int64 optional
Maximum pixels accepted across the comparison.
-Scale Double optional
Render scale applied before comparison.

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.