PrizmDoc® v14.2 Release - Updated
PrizmDoc / Developer Guide / PrizmDoc / How to Customize PrizmDoc / Work with Document Comparison Programmatically
In This Topic
    Work with Document Comparison Programmatically
    In This Topic

    Introduction

    The API offers methods to request revisions and to get those requested revisions once they have been retrieved.

    Requesting and Getting Revisions

    Request the revisions for a given document comparison. Revisions requests complete asynchronously. A PCCViewer.RevisionsRequest will be returned that provides events for revisions retrieval progress and members to access retrieved revisions:

    Example

    // Request revisions
    var revisionsRequest = viewerControl.requestRevisions(); 
    // Subscribe to the PartialRevisionsAvailable event to get revisions as they become available
    revisionsRequest.on('PartialRevisionsAvailable', function(_event) { 
        // Get the newly available revisions
        var newRevisions = _event.partialRevisions; 
    });
    // Subscribe to the RevisionsRetrievalCompleted event to get revisions when all of them are available
    revisionsRequest.on("RevisionsRetrievalCompleted", function(){ 
        // Get all of the revisions for that comparison
        var revisions = revisionsRequest.getRevisions();
    });