Skip to content

Commit

Permalink
Review + Java, NodeJS
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel-A-Sokolov committed Oct 18, 2023
1 parent 4c964b6 commit 72a145d
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 91 deletions.
98 changes: 59 additions & 39 deletions java/getting-started/licensing-and-subscription.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,56 @@
---
id: licensing-and-subscription
url: viewer/java/licensing-and-subscription
title: Licensing
title: Licensing and evaluation
weight: 5
keywords: free, free trial, evaluation, groupdocs viewer java
description: "GroupDocs.Viewer for Java provides different plans for purchase or offers a Free Trial and a 30-day Temporary License for evaluation."
productName: GroupDocs.Viewer for Java
hideChildren: False
toc: True
---
Sometimes, in order to study the system better, you want to dive into the code as fast as possible. To make this easier, GroupDocs.Viewer provides different plans for purchase or offers a Free Trial and a 30-day Temporary License for evaluation.

To study the system, you may want quick access to the API. To make this easier, GroupDocs.Viewer provides different plans for purchase and offers a Free Trial and a 30-day Temporary License for evaluation.

{{< alert style="info" >}}

Note that there are a number of general policies and practices that guide you on how to evaluate, properly license, and purchase our products. You can find them in the ["Purchase Policies and FAQ"](https://purchase.groupdocs.com/policies) section.
Note that there are a number of general policies and practices that guide you on how to evaluate, properly license, and purchase our products. You can find them in the [Purchase Policies and FAQ](https://purchase.groupdocs.com/policies) section.

{{< /alert >}}

## Free Trial or Temporary License

You can try GroupDocs.Viewer without buying a license.

### Free Trial

The evaluation version is the same as the purchased one – the evaluation version simply becomes licensed when you set the license. You can set the license in a number of ways that described in the next sections of this article.

The evaluation version comes with the limitations:

- Only first 2 pages can be rendered.
- Trial badges are placed in the rendering results on the top of each page.

### Temporary License

If you wish to test GroupDocs.Viewer without the limitations of the trial version, you can also request a 30-day Temporary License. For more details, see the ["Get a Temporary License"](https://purchase.groupdocs.com/temporary-license) page.
## Purchased License

## How to set a license
After buying, apply the license file or include it as an embedded resource.

{{< alert style="info" >}}
License needs to be set:
- Only once per application domain
- Before using any other GroupDocs.Viewer classes

### License Applying Options

You can find pricing information at ["Pricing Information"](https://purchase.groupdocs.com/pricing/viewer/java) page.
Licenses can be applied from different locations:

{{< /alert >}}
* Explicit path
* The folder containing the _GroupDocs.Viewer.dll_ file
* The folder containing the assembly that called _GroupDocs.Viewer.dll_
* The folder containing the entry assembly (your _.exe_)
* As a Metered License that allows you to pay for your usage. For details, see the [Metered Licensing FAQ](https://purchase.groupdocs.com/faqs/licensing/metered/).

After the license is obtained you need to set the license. This section describes options of how this can be done, and also comments on some common questions.
When you reference _GroupDocs.Viewer.dll_ in the application, the library is copied to your output directory (unless **Copy Local** in the properties for that entry is set to false). The easiest way to set a license is often to place the license file in the same folder as _GroupDocs.Viewer.dll_ and specify just the filename without the path.

The license should be set:
Use the [setLicense](https://reference.groupdocs.com/viewer/java/com.groupdocs.viewer/license/#setLicense-java.io.InputStream-) method to license a component.

- Only once per application domain,
- and before using any other GroupDocs.Viewer classes.
Calling `setLicense` multiple times is not harmful, it simply wastes processor time.

{{< alert style="info" >}}
Calling [setMeteredKey](https://reference.groupdocs.com/viewer/java/com.groupdocs.viewer/metered/#setMeteredKey-java.lang.String-java.lang.String-) multiple times is not harmful either but wastes processor time and can accumulate consumption improperly.

The license can be set multiple times per app domain but we recommend doing it once since all calls to `SetLicense` except first will just waste processor time.
#### Apply the License

{{< /alert >}}
After obtaining the license, set it. This section explains how to do this. When developing your application, call the `setLicense` method in your startup code before using the GroupDocs.Viewer classes.

### Set License from File
##### Set a License from a File

The following code sets a license from file.
The following code snippet shows how to set a license from file:

{{< tabs "example1">}}
{{< tab "Java" >}}
Expand All @@ -71,10 +64,9 @@ license.setLicense(licensePath);
{{< /tab >}}
{{< /tabs >}}

##### Set a License from a Stream

### Set License from Stream

The following example shows how to set a license from a stream.
The following code snippet shows how to set a license from a stream:

{{< tabs "example2">}}
{{< tab "Java" >}}
Expand All @@ -90,12 +82,11 @@ try (InputStream fileStream = new FileInputStream(licensePath)) {
{{< /tab >}}
{{< /tabs >}}

#### Apply Metered License

### Set Metered License

You can also set [Metered](https://reference.groupdocs.com/viewer/java/com.groupdocs.viewer/metered) license as an alternative to license file. It is a new licensing mechanism that will be used along with existing licensing method. It is useful for the customers who want to be billed based on the usage of the API features. For more details, please refer to [Metered Licensing FAQ](https://purchase.groupdocs.com/faqs/licensing/metered) section.
You can set the [Metered](https://reference.groupdocs.com/net/viewer/groupdocs.viewer/metered) license as an alternative to license file. It is useful for the customers who want to be billed based on the usage of the API features. For more details, please refer to [Metered Licensing FAQ](https://purchase.groupdocs.com/faqs/licensing/metered).

Following is the sample code demonstrating how to use `Metered` licensing.
The following code snippet shows how to use the metered license:

{{< tabs "example3">}}
{{< tab "Java" >}}
Expand All @@ -119,3 +110,32 @@ System.out.println("Credits consumed: " + creditsConsumed);

{{< /tab >}}
{{< /tabs >}}

### Changing the License File Name

You do not have to name the license file "GroupDocs.Viewer.lic". Feel free to rename it as you prefer, and use that name when setting the license in your application.

### "Cannot find license filename" Exception

When you buy and download a license from the GroupDocs website, the license file is named "GroupDocs.Viewer.lic." Download it using your browser. Sometimes, browsers recognize it as XML and add the .xml extension, making the full file name "GroupDocs.Viewer.lic.XML" on your computer.

If Microsoft Windows is set to hide file extensions (which is the default in most installations), the license file will show as "GroupDocs.Viewer.lic" in Windows Explorer. You might assume this is the actual file name and call the `setLicense` method with "GroupDocs.Viewer.lic", but there is no such file, leading to an exception.

To fix this issue, rename the file to remove the hidden .xml extension. Additionally, we suggest disabling the "Hide extensions" option in Microsoft Windows.

## How to Evaluate GroupDocs.Viewer

You can also try GroupDocs.Viewer without buying a license.

### Free Trial

The evaluation version is identical to the purchased one; it becomes licensed once you set the license. You can set the license using methods described in the following sections of this article.

The evaluation version has the following limitations:

- Rendering is limited to the first 2 pages.
- Trial badges are added to the top of a rendered page.

### Temporary License

If you want to test GroupDocs.Viewer without the limitations of the trial version, request a 30-day Temporary License. For details, see the ["Get a Temporary License"](https://purchase.groupdocs.com/temporary-license) page.
21 changes: 5 additions & 16 deletions net/getting-started/licensing-and-subscription.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ License needs to be set:
- Only once per application domain
- Before using any other GroupDocs.Viewer classes

You can find the pricing information on the [Purchase Policies and FAQ](https://purchase.groupdocs.com/policies) page.

### License Applying Options

Licenses can be applied from different locations:
Expand All @@ -35,8 +33,7 @@ Licenses can be applied from different locations:
* The folder containing the _GroupDocs.Viewer.dll_ file
* The folder containing the assembly that called _GroupDocs.Viewer.dll_
* The folder containing the entry assembly (your _.exe_)
* An embedded resource in the assembly is called _GroupDocs.Viewer.dll_
* As a Metered License - a new licensing mechanism
* As a Metered License that allows you to pay for your usage. For details, see the [Metered Licensing FAQ](https://purchase.groupdocs.com/faqs/licensing/metered/).

When you reference _GroupDocs.Viewer.dll_ in the application, the library is copied to your output directory (unless **Copy Local** in the properties for that entry is set to false). The easiest way to set a license is often to place the license file in the same folder as _GroupDocs.Viewer.dll_ and specify just the filename without the path.

Expand All @@ -58,7 +55,7 @@ The following code snippet shows how to set a license from file:
{{< tab "C#" >}}

```csharp
string licensePath = "path to the .lic file";
string licensePath = "GroupDocs.Viewer.lic";
License license = new License();
license.SetLicense(licensePath);
```
Expand All @@ -74,7 +71,7 @@ The following code snippet shows how to set a license from a stream:
{{< tab "C#" >}}

```csharp
string licensePath = "path to the .lic file";
string licensePath = "GroupDocs.Viewer.lic";
using (FileStream fileStream = File.OpenRead(licensePath))
{
License license = new License();
Expand All @@ -85,17 +82,9 @@ using (FileStream fileStream = File.OpenRead(licensePath))
{{< /tab >}}
{{< /tabs >}}

#### Include the License File as an Embedded Resource

A tidy method to bundle a license with your application and ensure it will not be lost is to include it as an embedded resource in one of the assemblies calling GroupDocs.Viewer. To include a file as an embedded resource, follow these steps:

1. In Visual Studio, add the .lic file to the project using the **File | Add Existing Item...** menu.
2. Select the file in the Solution Explorer and set **Build Action to Embedded Resource** in the **Properties** window.
3. In your code, invoke `SetLicense` with only the short name of the resource file.

#### Apply Metered License

You can set the [Metered](https://reference.groupdocs.com/net/viewer/groupdocs.viewer/metered) license as an alternative to license file. It is a new licensing mechanism that will be used along with existing licensing method. It is useful for the customers who want to be billed based on the usage of the API features. For more details, please refer to [Metered Licensing FAQ](https://purchase.groupdocs.com/faqs/licensing/metered) section.
You can set the [Metered](https://reference.groupdocs.com/net/viewer/groupdocs.viewer/metered) license as an alternative to license file. It is useful for the customers who want to be billed based on the usage of the API features. For more details, please refer to [Metered Licensing FAQ](https://purchase.groupdocs.com/faqs/licensing/metered).

The following code snippet shows how to use the metered license:

Expand Down Expand Up @@ -142,7 +131,7 @@ The evaluation version is identical to the purchased one; it becomes licensed on
The evaluation version has the following limitations:

- Rendering is limited to the first 2 pages.
- Trial badges are added to the top of each rendered page.
- Trial badges are added to the top of a rendered page.

### Temporary License

Expand Down
93 changes: 57 additions & 36 deletions nodejs-java/getting-started/licensing-and-subscription.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,56 @@
---
id: licensing-and-subscription
url: viewer/nodejs-java/licensing-and-subscription
title: Licensing
title: Licensing and evaluation
weight: 5
keywords: free, free trial, evaluation, groupdocs viewer java
description: "GroupDocs.Viewer for Node.js provides different plans for purchase or offers a Free Trial and a 30-day Temporary License for evaluation."
productName: GroupDocs.Viewer for Node.js via Java
hideChildren: False
toc: True
---
Sometimes, in order to study the system better, you want to dive into the code as fast as possible. To make this easier, GroupDocs.Viewer provides different plans for purchase or offers a Free Trial and a 30-day Temporary License for evaluation.

To study the system, you may want quick access to the API. To make this easier, GroupDocs.Viewer provides different plans for purchase and offers a Free Trial and a 30-day Temporary License for evaluation.

{{< alert style="info" >}}

Note that there are a number of general policies and practices that guide you on how to evaluate, properly license, and purchase our products. You can find them in the ["Purchase Policies and FAQ"](https://purchase.groupdocs.com/policies) section.
Note that there are a number of general policies and practices that guide you on how to evaluate, properly license, and purchase our products. You can find them in the [Purchase Policies and FAQ](https://purchase.groupdocs.com/policies) section.

{{< /alert >}}

## Free Trial or Temporary License

You can try GroupDocs.Viewer without buying a license.

### Free Trial

The evaluation version is the same as the purchased one – the evaluation version simply becomes licensed when you set the license. You can set the license in a number of ways that described in the next sections of this article.

The evaluation version comes with the limitations:

- Only first 2 pages can be rendered.
- Trial badges are placed in the rendering results on the top of each page.

### Temporary License

If you wish to test GroupDocs.Viewer without the limitations of the trial version, you can also request a 30-day Temporary License. For more details, see the ["Get a Temporary License"](https://purchase.groupdocs.com/temporary-license) page.
## Purchased License

## How to set a license
After buying, apply the license file or include it as an embedded resource.

{{< alert style="info" >}}
License needs to be set:
- Only once per application domain
- Before using any other GroupDocs.Viewer classes

### License Applying Options

You can find pricing information at ["Pricing Information"](https://purchase.groupdocs.com/pricing/viewer/nodejs-java) page.
Licenses can be applied from different locations:

{{< /alert >}}
* Explicit path
* The folder containing the _GroupDocs.Viewer.dll_ file
* The folder containing the assembly that called _GroupDocs.Viewer.dll_
* The folder containing the entry assembly (your _.exe_)
* As a Metered License that allows you to pay for your usage. For details, see the [Metered Licensing FAQ](https://purchase.groupdocs.com/faqs/licensing/metered/).

After the license is obtained you need to set the license. This section describes options of how this can be done, and also comments on some common questions.
When you reference _GroupDocs.Viewer.dll_ in the application, the library is copied to your output directory (unless **Copy Local** in the properties for that entry is set to false). The easiest way to set a license is often to place the license file in the same folder as _GroupDocs.Viewer.dll_ and specify just the filename without the path.

The license should be set:
Use the [setLicense](https://reference.groupdocs.com/viewer/java/com.groupdocs.viewer/license/#setLicense-java.io.InputStream-) method to license a component.

- Only once per application domain,
- and before using any other GroupDocs.Viewer classes.
Calling `setLicense` multiple times is not harmful, it simply wastes processor time.

{{< alert style="info" >}}
Calling [setMeteredKey](https://reference.groupdocs.com/viewer/java/com.groupdocs.viewer/metered/#setMeteredKey-java.lang.String-java.lang.String-) multiple times is not harmful either but wastes processor time and can accumulate consumption improperly.

The license can be set multiple times per app domain but we recommend doing it once since all calls to `setLicense` except first will just waste processor time.
#### Apply the License

{{< /alert >}}
After obtaining the license, set it. This section explains how to do this. When developing your application, call the `setLicense` method in your startup code before using the GroupDocs.Viewer classes.

### Set License from File
##### Set a License from a File

The following code sets a license from file.
The following code snippet shows how to set a license from file:

{{< tabs "example1">}}
{{< tab "JavaScript" >}}
Expand All @@ -71,10 +64,9 @@ license.setLicense(licensePath);
{{< /tab >}}
{{< /tabs >}}

##### Set a License from a Stream

### Set License from Stream

The following example shows how to set a license from a stream.
The following code snippet shows how to set a license from a stream:

{{< tabs "example2">}}
{{< tab "JavaScript" >}}
Expand All @@ -95,4 +87,33 @@ groupdocs.conversion.License.setLicenseFromStream(license, licStream, err => {
```

{{< /tab >}}
{{< /tabs >}}
{{< /tabs >}}

### Changing the License File Name

You do not have to name the license file "GroupDocs.Viewer.lic". Feel free to rename it as you prefer, and use that name when setting the license in your application.

### "Cannot find license filename" Exception

When you buy and download a license from the GroupDocs website, the license file is named "GroupDocs.Viewer.lic." Download it using your browser. Sometimes, browsers recognize it as XML and add the .xml extension, making the full file name "GroupDocs.Viewer.lic.XML" on your computer.

If Microsoft Windows is set to hide file extensions (which is the default in most installations), the license file will show as "GroupDocs.Viewer.lic" in Windows Explorer. You might assume this is the actual file name and call the `setLicense` method with "GroupDocs.Viewer.lic", but there is no such file, leading to an exception.

To fix this issue, rename the file to remove the hidden .xml extension. Additionally, we suggest disabling the "Hide extensions" option in Microsoft Windows.

## How to Evaluate GroupDocs.Viewer

You can also try GroupDocs.Viewer without buying a license.

### Free Trial

The evaluation version is identical to the purchased one; it becomes licensed once you set the license. You can set the license using methods described in the following sections of this article.

The evaluation version has the following limitations:

- Rendering is limited to the first 2 pages.
- Trial badges are added to the top of a rendered page.

### Temporary License

If you want to test GroupDocs.Viewer without the limitations of the trial version, request a 30-day Temporary License. For details, see the ["Get a Temporary License"](https://purchase.groupdocs.com/temporary-license) page.

0 comments on commit 72a145d

Please sign in to comment.