getDigitalCertificates(callback)

Retrieves the digital certificates embedded in a PDF file.

This is an asynchronous function and requires a callback object to handle the results. The callback object must include the following methods:
  • onSuccess(certificates)
    This method is triggered when the digital certificates are successfully fetched. The certificates parameter contains the retrieved certificates.
  • onError(errorMsg)
    This method is called when an error occurs during the retrieval process. The errorMsg parameter provides details about the error.

Sample syntax


{{ // Define the callback object
const certificateCallback = {
onSuccess: function (certificates)
{ console.log("Certificates retrieved successfully:", certificates); // Process the certificates as needed }

,
onError: function (errorMsg)
{ console.error("Error retrieving certificates:", errorMsg); // Handle the error accordingly alert("Failed to fetch certificates: " + errorMsg); }

};

// Call the API
viewONE.getDigitalCertificates(certificateCallback);}}