com.groupdocs.merger.licensing.metered

Class Metered



  • public class Metered
    extends Object

    Provides methods which allow to activate product with Metered license and retrieve amount of MBs processed. Learn more about Metered licenses <a href="https://purchase.groupdocs.com/faqs/licensing/metered">here</a>.

    • Constructor Detail

      • Metered

        public Metered()
    • Method Detail

      • getConsumptionQuantity

        public static double getConsumptionQuantity()
                                             throws Exception

        Retrieves amount of MBs processed.


          Following example demonstrates how to retrieve amount of MBs processed.
          
          string publicKey = "Public Key";
          string privateKey = "Private Key";
        
          Metered metered = new Metered();
          metered.SetMeteredKey(publicKey, privateKey);
          decimal mbProcessed = Metered.GetConsumptionQuantity();
          

        Throws:
        Exception
      • getCreditsQuantity

        public static double getCreditsQuantity()
                                         throws Exception

        Retrieves amount of used credits


          Following example demonstrates how to retrieve amount of MBs processed.
          
          string publicKey = "Public Key";
          string privateKey = "Private Key";
        
          Metered metered = new Metered();
          metered.SetMeteredKey(publicKey, privateKey);
          decimal usedCredits = Metered.GetCreditsQuantity();
          

        Throws:
        Exception
      • setMeteredKey

        public final void setMeteredKey(String publicKey,
                         String privateKey)
                                 throws Exception

        Activates product with Metered keys.


         Following example demonstrates how to activate product with Metered keys.
         
         string publicKey = "Public Key";
         string privateKey = "Private Key";
         Metered metered = new Metered();
         metered.SetMeteredKey(publicKey, privateKey);
         

        Parameters:
        publicKey - The public key.
        privateKey - The private key.
        Throws:
        Exception