public class Metered extends Object
Metered licensing allows you to dynamically monitor and control the usage of GroupDocs.Viewer based on the number of document pages processed instead of a traditional per-server or per-developer license. This flexible licensing model is suitable for scenarios where the document processing requirements vary over time or when you want to pay only for what you use.
Example usage:
Metered metered = new Metered();
metered.setMeteredKey(publicKey, privateKey);
// Perform document processing operations using GroupDocs.Viewer
// ...
| Constructor and Description |
|---|
Metered() |
| Modifier and Type | Method and Description |
|---|---|
static double |
getConsumptionCredit()
Retrieves the count of credits consumed.
|
static double |
getConsumptionQuantity()
Retrieves the amount of megabytes (MB) processed.
|
void |
setMeteredKey(String publicKey,
String privateKey)
Activates the product with Metered keys.
|
public static double getConsumptionCredit()
Retrieves the count of credits consumed.
This method returns the total count of credits consumed by the component.
Example:
String publicKey = "Public Key";
String privateKey = "Private Key";
Metered metered = new Metered();
metered.setMeteredKey(publicKey, privateKey);
double creditsConsumed = Metered.getConsumptionCredit();
public static double getConsumptionQuantity()
throws Exception
Retrieves the amount of megabytes (MB) processed.
This method returns the total amount of MB processed by the component.
Example:
String publicKey = "Public Key";
String privateKey = "Private Key";
Metered metered = new Metered();
metered.setMeteredKey(publicKey, privateKey);
double mbProcessed = Metered.getConsumptionQuantity();
Exception - If an error occurs while retrieving the consumption quantity.public final void setMeteredKey(String publicKey, String privateKey)
Activates the product with Metered keys.
Following example demonstrates how to activate product with Metered keys.
Example:
String publicKey = "Public Key";
String privateKey = "Private Key";
Metered metered = new Metered();
metered.setMeteredKey(publicKey, privateKey);
publicKey - The public key.privateKey - The private key.Copyright © 2025. All rights reserved.