Skip to content

Page::Compare method

The Compare method allows you to compare two pages returning the differences.

Overloads

Compare(Page, CompareSettings) The Compare method allows you to compare two pages returning the differences.
Compare(Page, System.Drawing.RectangleF, CompareSettings) The Compare method allows you to compare two pages, applying margins, returning the differences.
Compare(Page, System.Drawing.RectangleF, System.Drawing.RectangleF, CompareSettings) The Compare method allows you to compare two pages, applying margins, returning the differences.

Compare(Page, CompareSettings)

Prototype

CompareResults Compare(Page otherPage, CompareSettings settings)
CompareResults Compare(Page otherPage, CompareSettings settings) throws IGRException;
def Compare(self, otherPage: Page, settings: CompareSettings) -> CompareResults

Parameters

otherPage: Page : Provide the other Page to compare.

settings: CompareSettings : Provide the settings that control the compare logic.

Return value

CompareResults : A new instance of a CompareResults interface.


Compare(Page, System.Drawing.RectangleF, CompareSettings)

Prototype

CompareResults Compare(Page otherPage, System.Drawing.RectangleF margins, CompareSettings settings)

Parameters

otherPage: Page : Provide the other Page to compare.

margins: System.Drawing.RectangleF : The margins to apply to both pages.

settings: CompareSettings : Provide the settings that control the compare logic.

Return value

CompareResults : A new instance of a CompareResults interface.


Compare(Page, System.Drawing.RectangleF, System.Drawing.RectangleF, CompareSettings)

Prototype

CompareResults Compare(Page otherPage, System.Drawing.RectangleF leftMargins, System.Drawing.RectangleF rightMargins, CompareSettings settings)

Parameters

otherPage: Page : Provide the other Page to compare.

leftMargins: System.Drawing.RectangleF : The margins to apply to the left/original page.

rightMargins: System.Drawing.RectangleF : The margins to apply to the right/revised page.

settings: CompareSettings : Provide the settings that control the compare logic.

Return value

CompareResults : A new instance of a CompareResults interface.


Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
using Hyland.DocumentFilters;

var api = new Hyland.DocumentFilters.Api();
api.Initialize("License Code", ".");

using (var doc1 = api.OpenExtractor(GetTestFilename("original.docx"), OpenMode.Paginated))
using (var doc2 = api.OpenExtractor(GetTestFilename("revision.docx"), OpenMode.Paginated))
using (var page1 = doc1.GetPage(0))
using (var page2 = doc2.GetPage(0))
using (var compare = page1.Compare(page2))
{
    while (compare.MoveNext())
    {
        var diff = compare.Current;
        // work with diff...
    }
}

See Also