Metered Licensing

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

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

  3. Do some processing (perform tasks).

  4. Call the get_consumption_quantity() method of the Metered class.

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

This Python code shows you how to set metered public and private keys:

import aspose.slides as slides

# Creates an instance of CAD Metered class
metered = slides.Metered()

# Accesses the set_metered_key property and pass public and private keys as parameters
metered.set_metered_key("*****", "*****")

# Gets the metered data amount before calling API
amountbefore = slides.metered.get_consumption_quantity()
# Display information
print("Amount Consumed Before: " + str(amountbefore))

# Loads the document from disk.
with slides.Presentation("Presentation.pptx") as pres:
   #Gets the page count of document
   print(len(pres.slides))
   # Saves as PDF
   pres.save("out_pdf.pdf", slides.export.SaveFormat.PDF)

# Gets the metered data amount After calling API
amountafter = slides.metered.get_consumption_quantity()
# Displays information
print("Amount Consumed After: " + str(amountafter))