We are trying to get visibility into the amount of Aspose credits we are using each month.
We’ve reviewed this documentation: https://reference.aspose.com/pdf/net/aspose.pdf/metered/
-
When we get consumption credits, what is the time period? In other words, does the method return the number of credits all time? Over the last month? 30 days? Other?
-
The documentation has examples of the SetMeteredKey method, but we don’t see any examples of the GetConsumptionCredit and GetConsumptionQuantity methods; can you please provide examples in your documentation?
@sthomasco
We are checking these details and will get back to you soon.
@sthomasco
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): PDFNET-55079
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Thank you @asad.ali - can you provide any details on what needs to be fixed and what the fix is?
@sthomasco
This is an investigation ticket to analyze the feasibility of the required functionality and provide the code sample as well if possible. As soon as this investigation is complete we will inform you in this forum thread. Please spare us some time.
@sthomasco
“When we get consumption credits, what is the time period? In other words, does the method return the number of credits all time? Over the last month? 30 days? Other?”
The method return the number of credits (not yet paid). The number of credits is reset to zero every time a new invoice is issued for them.
Usually, the metered invoices are issued once per month.
“The documentation has examples of the SetMeteredKey method, but we don’t see any examples of the GetConsumptionCredit and GetConsumptionQuantity methods; can you please provide examples in your documentation?”
Example:
// Set metered public and private keys
var metered = new Aspose.Pdf.Metered();
metered.SetMeteredKey(
"<type public key here>",
"<type private key here>"
);
//Get current Consumption Credit and Quantity
var wasCredit = Metered.GetConsumptionCredit();
var wasQuantity = Metered.GetConsumptionQuantity();
//Any use of Library
var doc = new Document();
doc.Pages.Add();
doc.Save(dataDir + "example");
//Little wait to be sure the transaction completed
System.Threading.Thread.Sleep(10000);
//Get current Consumption Credit and Quantity
var nowCredit = Metered.GetConsumptionCredit();
var nowQuantity = Metered.GetConsumptionQuantity();
//Show Info
Console.WriteLine($"Credit: was={wasCredit} now={nowCredit} difference={nowCredit - wasCredit}");
Console.WriteLine($"Quantity: was={wasQuantity} now={nowQuantity} difference={nowQuantity - wasQuantity}");
We do apologize about the missing documentation. However, we have taken this into our account and will publish this information in the public API documentation as well.
Thank you @asad.ali. Our team has put this work on hold for the moment, I’ll be back in touch if we have any questions for you once we implement.
@sthomasco
Sure, please take your time and feel free to write back.