メーター方式のライセンス
Contents
[
Hide
]Aspose.CADは、開発者がメーター方式のキーを適用できるようにします。これは新しいライセンス機構です。この新しいライセンス機構は、既存のライセンス方法と併用されます。API機能の使用に基づいて請求されたい顧客は、メーター方式のライセンスを使用することができます。詳細については、メーター方式のライセンス FAQ セクションをご覧ください。
メーター方式のライセンス
メータークラスを使用するための簡単な手順は次のとおりです。
- メータークラスのインスタンスを作成します。
- setMeteredKey メソッドに公開鍵と秘密鍵を渡します。
- 処理を実行します(タスクを実行)。
- メータークラスのメソッド getConsumptionQuantity を呼び出します。
- これにより、これまでに消費したAPIリクエストの量が返されます。
以下は、メーター方式の公開鍵と秘密鍵を設定する方法を示すサンプルコードです:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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()); |