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 Java code shows you how to set metered public and private keys:

com.aspose.slides.Metered metered=new com.aspose.slides.Metered();
try {
    // Accesses the setMeteredKey property and pass public and private keys as parameters
    metered.setMeteredKey("<valid pablic key>", "<valid private key>");

    // Gets the consumed qantity value before accessing API
    double quantityOld = com.aspose.slides.Metered.getConsumptionQuantity();
    System.out.println("Consumption quantity" + quantityOld);


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