PrizmDoc® Viewer v13.28 Release - Updated
PrizmDoc Viewer / Developer Guide / Viewer / How to Customize the Viewer / 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();
    });