Document download

Download documents

  • Object: getARenderJS().getDownloadDocumentJSAPI()
    Function Description
    askDownloadDocumentPDF() Download the current document in PDF
    askDownloadDocumentSource() Download the current document in source format
    askDownloadAllDocuments() Download a single PDF with all opened documents
    registerNotifyDocumentDownloadEvent(notifyDocumentDownloadTriggeredHandler) Trigger a callback function when a document download is asked
scripts/example.js
function arenderjs_init(arenderjs_)
{
  arenderjs_.getDownloadDocumentJSAPI().registerNotifyDocumentDownloadEvent(
    function(documentId, action) {
      getARenderJS().getCurrentUserName(function(name) {
        var currentDate = new Date();
        console.error(
          "The user " + name +
          " triggered a download document of type " + action +
          " on documentId=" + documentId +
          " at " + currentDate
        );
      });
    }
  );
}