Metered Licensing

Contents
[ ]
  1. Create an instance of the Metered class.

  2. Pass your public and private keys to the setMeteredKey method.

  3. Do some processing (perform tasks).

  4. Call the getConsumptionQuantity method of the Metered class.

You should see the amount/quantity of API requests you have consumed so far.

This sample code shows you how to use metered licensing:

// Creates an instance of the Metered class
com.aspose.slides.Metered metered = new com.aspose.slides.Metered();

try {
    // Passes the public and private keys to the Metered object
    metered.setMeteredKey("<valid public key>", "<valid private key>");

    // Gets the consumed quantity value before API calls
    double amountBefore = com.aspose.slides.Metered.getConsumptionQuantity();
    System.out.println("Amount consumed before: " + amountBefore);

    // Do something with Aspose.Slides API here
    // ...

    // Gets the consumed quantity value after API calls
    double amountAfter = com.aspose.slides.Metered.getConsumptionQuantity();
    System.out.println("Amount consumed after: " + amountAfter);
} catch (Exception ex) {
    ex.printStackTrace();
}