メーター方式のライセンス

メーター方式のライセンス

メータークラスを使用するための簡単な手順は次のとおりです。

  1. メータークラスのインスタンスを作成します。
  2. setMeteredKey メソッドに公開鍵と秘密鍵を渡します。
  3. 処理を実行します(タスクを実行)。
  4. メータークラスのメソッド getConsumptionQuantity を呼び出します。
  5. これにより、これまでに消費したAPIリクエストの量が返されます。

以下は、メーター方式の公開鍵と秘密鍵を設定する方法を示すサンプルコードです:

// 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());