Skip to content

Licensing in GroupDocs.Editor RESTful for .NET

Viktor Stupak edited this page Apr 11, 2024 · 3 revisions

After configuring file storage options in your GroupDocs.Editor RESTful service, the next crucial step is licensing. Proper licensing ensures that your application operates within the legal boundaries and unlocks the full potential of GroupDocs.Editor. In this article, we will discuss how to set up licensing in GroupDocs.Editor RESTful for .NET.

Setting up Licensing

To begin, you need to obtain a license for GroupDocs.Editor. You can acquire a license from GroupDocs website or through authorized resellers. Once you have the license, you can proceed with configuring it in your application.

Adding License Configuration to appsettings.json

To configure the license in your ASP.NET Core Web API project, add the following configuration to your appsettings.json file:

{
  "LicenseOptions": {
    "Type": 1,
    "Source": "https://docs.groupdocs.com/editor/net/licensing-and-subscription/"
  }
}

Here's the new wiki article explaining the different types of licensing for GroupDocs.Editor:


Applying the License

After adding the license configuration, you need to apply the license within your application. Depending on the type of license source specified in the configuration, you will apply the license accordingly.

// add license for GroupDocs.Editor or remove for use Trial mode.
builder.Services.AddEditorLicense<Base64FileLicenseService>(builder.Configuration);

Different Types of Licensing for GroupDocs.Editor

GroupDocs.Editor offers different types of licensing options to suit varying requirements. Each licensing type has its own characteristics and usage scenarios.

1) Base64FileLicenseService

The Base64FileLicenseService is used to license GroupDocs.Editor with a license file provided in base64 format. Here's an example configuration:

"LicenseOptions": {
    "Type": 2,
    "Source": "PD94bWwgdmVyc2lvbj0iMS4wIj8+CjxMaWNlbnNlPgogIDxEYXRhPgogICAgPExpY2Vuc2VkVG8+QXNwb3NlIFB0eSBMdGQ8L0xpY2Vuc2VkVG8+CiAgICA8RW1haWxUbz55ZXZnZW4ubnlreXRlbmtvQGFzcG9zZS5jb208L0VtYWlsVuc2U+"
}

In this configuration, Type is set to 2, indicating that the license is provided in base64 format.

2) LocalFileLicenseService

The LocalFileLicenseService is used to license GroupDocs.Editor with a license file stored locally on the machine. Here's an example configuration:

"LicenseOptions": {
    "Type": 0,
    "Source": "C:\\folderToLicense\\GroupDocs.Editor.lic"
}

In this configuration, Type is set to 0, indicating that the license is stored locally on the machine.

3) RemoteUrlFileLicenseService

The RemoteUrlFileLicenseService is used to license GroupDocs.Editor with a license file obtained from a remote URL. Here's an example configuration:

"LicenseOptions": {
    "Type": 1,
    "Source": "https://docs.groupdocs.com/editor/net/licensing-and-subscription/GroupDocs.Editor.lic"
}

In this configuration, Type is set to 1, indicating that the license is obtained from a remote URL.

Explanation of Configuration Parameters:

  • Type: Specifies the type of license source. Options include:
    • 0: LocalPath - The license stored locally.
    • 1: RemoteUrl - The license stored remotely, and it should be read from a URL.
    • 2: Base64 - The license stored as a base64 string.
  • Source: Specifies the source from where the license should be obtained. It could be a local file path, a remote URL, or a base64 string representing the license.

Choose the licensing type that best fits your deployment and licensing management strategy.

Conclusion

Configuring licensing in GroupDocs.Editor RESTful for .NET is essential for ensuring compliance with legal requirements and unlocking the full functionality of the API. By following the steps outlined in this article and obtaining a valid license, you can seamlessly integrate GroupDocs.Editor into your application and leverage its powerful document editing capabilities.

For more detailed information on licensing and subscription options, refer to the GroupDocs.Editor documentation.

Clone this wiki locally