ライセンス| JavaのAspose.Page

評価バージョンの制限

購入前に顧客にコンポーネントを徹底的にテストしてほしいので、評価バージョンを使用すると、通常どおりに使用できます。ただし、無認定製品:

クラシックライセンス

ライセンスは、ファイルまたはストリームオブジェクトからロードできます。ライセンスを設定する最も簡単な方法は、ライセンスファイルをAspose-page-xx.x.jarファイルと同じフォルダーに配置し、以下の例に示すように、パスなしでファイル名を指定することです。

ファイルまたはストリームオブジェクトを使用してライセンスを適用します

ライセンスを適用する最も簡単な方法は、ライセンスファイルをAspose-page-xx.x.jarファイルと同じフォルダーに配置し、パスのないファイル名のみを指定することです。

使用している場合は、JavaコンポーネントにAspose.PageのJavaコンポーネントに他のAsophesを使用している場合は、com.aspose.page.licenseなどのライセンスの完全な名前空間を指定してください。

ファイルからライセンスをロードします

ライセンスを適用する最も簡単な方法は、ライセンスファイルをAspose-page-xx.x.jarファイルと同じフォルダーに配置し、パスなしでファイル名のみを指定することです。

Setlicenseメソッドを呼び出す場合、渡すライセンス名はライセンスファイルのライセンス名である必要があります。たとえば、ライセンスファイル名を「aspose.page.java.lic.xml」に変更した場合、そのファイル名をcom.aspose.page.license.setlicense(…)メソッドに渡します。ライセンスファイルは、Java用のAspose.Pageに指定することも、JavaライセンスファイルにAspose.Totalを使用できます。

1// For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-Java
2// instantiate License object
3com.aspose.page.License license = new com.aspose.page.License();
4// license file path information
5license.setLicense("Aspose.Total.Java.lic");

ストリームオブジェクトからライセンスをロードします

次の例は、ストリームからライセンスをロードする方法を示しています。

1// For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-Java
2// Initialize License Instance
3com.aspose.page.License license = new com.aspose.page.License();
4// Set license from Stream
5license.setLicense(new java.io.FileInputStream("Aspose.Total.Java.lic"));

メーター付きライセンス

Aspose.Pageを使用すると、開発者はメーターキーを適用できます。これは新しいライセンスメカニズムです。新しいライセンスメカニズムは、既存のライセンス方法とともに使用されます。 API機能の使用に基づいて請求されたい顧客は、メーターのライセンスを使用できます。詳細については、 メーターライセンスFAQセクションを参照してください。

メーターキーを適用するために、新しいクラスメーターが導入されました。以下は、メーター付きのパブリックキーとプライベートキーを設定する方法を示すサンプルコードです。

 1// set metered public and private keys
 2com.aspose.page.Metered metered = new com.aspose.page.Metered();
 3// Access the setMeteredKey property and pass public and private keys as parameters
 4metered.setMeteredKey(
 5    "<type public key here>",
 6    "<type private key here>");
 7
 8// The path to the documents directory.
 9String dataDir = Utils.getDataDir();
10
11// Initialize PsDocument with PostScript file
12PsDocument document = new PsDocument(dataDir + "input.ps");
13
14//check if document is licensed
15if (document.isLicensed())
16    System.out.println("Metered License is set successfully.");
17else
18  System.out.println("Metered License is not set.");
19
20//Initialize options object with default parameters.
21ImageSaveOptions options = new ImageSaveOptions(ImageFormat.PNG);
22
23//Save EPS file as PNG images bytes. One bytes array for one page. In our case we have one page.
24byte[][] imagesBytes = document.saveAsImage(options);
25
26//Save image bytes to file
27FileOutputStream fs = new FileOutputStream(dataDir + "eps_out." + imageFormat.toString().toLowerCase());
28try {
29    fs.write(imagesBytes[0], 0, imagesBytes[0].length);
30} catch (IOException ex) {
31    System.out.println(ex.getMessage());
32} finally {
33    fs.close();
34}
35
36//Now we can check visually if Metered License is applied.
37//If resulting image doesn't contain red evaluation message It means Metered License is applied successfully.

Have any questions about Aspose.Page?



Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.