Metered Licensing

Metered Licensing

Here are the simple steps to use the Metered class.

  1. Create an instance of Metered class.
  2. Pass public & private keys to setMeteredKey method.
  3. Do processing (perform task).
  4. call method getConsumptionQuantity of the Metered class.
  5. It will return the amount/quantity of API requests that you have consumed so far.

Following is the sample code demonstrating how to set metered public and private key:

// For complete examples and data files, please go to https://github.com/aspose-cad/Aspose.CAD-for-Java
// Create an instance of OCR Metered class
com.aspose.cad.Metered metered = new com.aspose.cad.Metered();
// Access the setMeteredKey property and pass public and private keys as parameters
metered.setMeteredKey("<valid pablic key>", "<valid private key>");
// Get consumed qantity value before accessing API
double quantityOld = com.aspose.cad.Metered.getConsumptionQuantity();
System.out.println("Consumption quantity" + quantityOld);
// DO PROCESSING
//com.aspose.cad.fileformats.cad.CadImage image =
// (com.aspose.cad.fileformats.cad.CadImage)com.aspose.cad.Image.load("BlockRefDgn.dwg");
// Get consumed qantity value after accessing API
double quantity = com.aspose.cad.Metered.getConsumptionQuantity();
System.out.println("Consumption quantity" + quantity());