Compare PDF Files in MAUI

Document comparison in MAUI is used to visually compare pages of different documents. It’s helpful for things such as construction plans and detailed drawings, as well as other content that requires precise placement.

Document Comparison

Visual comparison is possible in PSPDFKit for MAUI using the Document Comparison component, which is available with the corresponding license component.

This makes it easy to compare the strokes of two vector-based documents and obtain a merged document where the differences between both input documents are highlighted and easily identifiable.

The Document Comparison UI can be invoked any time via the corresponding toolbar button under the editor dropdown group.

Document Comparison toolbar button.

The same button is used as a toggle — if pressed while the Document Comparison UI is active, it’ll switch to normal document mode.

Document Comparison toolbar button, active.

The button is available by default when the Document Comparison component is included in a license, but it can be hidden like any other toolbar button, if required.

Aligning Documents

In Document Comparison mode, you can start aligning a document by pressing the Align Documents button.

Align Documents toolbar button.

Then, on the first document, select three reference points on the page to be aligned with the same points of the second document.

Desktop Mode

As you click different coordinates of the page, new reference points are added and tracked in the top toolbar. Once three points are set, the second document is opened so as to perform the same operation.

Touch Mode

Mouse devices allow for increased accuracy when selecting coordinates on a page, in comparison to touch devices, where a specific point selected on the screen may be hidden by a finger.

To circumvent this limitation, PSPDFKit for MAUI implements a different strategy for manual point selection in touch devices: Instead of choosing coordinates on different parts of the page, you can drag the page under the cursor, which remains still, always at the center of the screen. This way, you’ll always see the specific coordinates you’re choosing, especially when zooming in.

Once the second group of three points has been selected, the comparison is performed by aligning the two documents according to the coordinates manually specified, and an output document is produced.

Customizing Comparison

The Document Comparison component can be customized in several ways by accessing JavaScript APIs. These APIs are similar to the ones available in our Web SDK. For more information, please refer to the Document Comparison API documentation of our Web SDK. If you’d like to bridge these APIs with your MAUI app, refer to our guide that explains how to bridge web APIs.

Free Trial

Enjoy unlimited trial usage of all our products. Get guidance and tech support from developers who built the product, and get started within minutes.