Skip to content

Commit

Permalink
Updated getting started examples
Browse files Browse the repository at this point in the history
  • Loading branch information
muqarrab-aspose committed Mar 12, 2024
1 parent efbf270 commit 3125ca4
Show file tree
Hide file tree
Showing 4 changed files with 167 additions and 91 deletions.
5 changes: 4 additions & 1 deletion content/english/net/getting-started/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ url: /net/getting-started/

## Getting Started Tutorials
### [Set License from File](./set-license-from-file/)
Learn how to integrate GroupDocs.Viewer for .NET into your applications effortlessly. Set license, view documents, and customize viewer appearance.
### [Set License from Stream](./set-license-from-stream/)
### [Set Metered License](./set-metered-license/)
Enhance your .NET applications with GroupDocs.Viewer for seamless document viewing. Follow our step-by-step guide and integrate powerful document viewing capabilities effortlessly.
### [Set Metered License](./set-metered-license/)
Enhance your .NET applications with GroupDocs.Viewer for seamless document viewing. Easily integrate document rendering functionalities into your projects.
85 changes: 53 additions & 32 deletions content/english/net/getting-started/set-license-from-file/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,68 @@
title: Set License from File
linktitle: Set License from File
second_title: GroupDocs.Viewer .NET API
description:
description: Learn how to integrate GroupDocs.Viewer for .NET into your applications effortlessly. Set license, view documents, and customize viewer appearance.
type: docs
weight: 10
url: /net/getting-started/set-license-from-file/
---
## Introduction
GroupDocs.Viewer for .NET is a powerful document viewer API that enables .NET developers to seamlessly integrate document viewing capabilities into their applications. Whether you need to display documents in various formats such as PDF, Microsoft Office, or images, GroupDocs.Viewer provides a reliable solution with extensive customization options.
## Prerequisites
Before diving into the implementation of GroupDocs.Viewer for .NET, ensure you have the following prerequisites:
### 1. .NET Framework Installed
Make sure you have the .NET Framework installed on your development machine. You can download it from the official Microsoft website.
### 2. GroupDocs.Viewer for .NET Package
Download and install GroupDocs.Viewer for .NET package from the [download link](https://releases.groupdocs.com/viewer/net/).
### 3. License File
Acquire a license file from [GroupDocs](https://purchase.groupdocs.com/buy) to utilize GroupDocs.Viewer for .NET without any limitations.
### 4. Temporary License (Optional)
If you want to explore the capabilities of GroupDocs.Viewer for .NET before purchasing a license, you can request a temporary license from [here](https://purchase.groupdocs.com/temporary-license/).
### 5. Familiarity with C# Programming Language
Basic knowledge of C# programming language is essential to follow along with the examples provided in this tutorial.

## Import Namespaces
In your C# project, import the necessary namespaces to utilize GroupDocs.Viewer for .NET functionalities.

## Complete Source Code
```csharp
using System;
using System.IO;
```

namespace GroupDocs.Viewer.Examples.CSharp.QuickStart
## Step 1: Check License File Existence
```csharp
if (File.Exists(Utils.LicensePath))
{
/// <summary>
/// This example demonstrates how to set license from file.
/// </summary>
/// <remarks>
/// The SetLicense method attempts to set a license from several locations relative to the executable and GroupDocs.Viewer.dll.
/// You can also use the additional overload to load a license from a stream, this is useful for instance when the
/// License is stored as an embedded resource.
/// </remarks>
class SetLicenseFromFile
{
public static void Run()
{
if (File.Exists(Utils.LicensePath))
{
License license = new License();
license.SetLicense(Utils.LicensePath);

Console.WriteLine("License set successfully.");
}
else
{
Console.WriteLine("\nWe do not ship any license with this example. " +
"\nVisit the GroupDocs site to obtain either a temporary or permanent license. " +
"\nLearn more about licensing at https://purchase.groupdocs.com/faqs/licensing. " +
"\nLearn how to request temporary license at https://purchase.groupdocs.com/temporary-license.");
}
}
}
```
## Step 2: Set License from File
```csharp
License license = new License();
license.SetLicense(Utils.LicensePath);
Console.WriteLine("License set successfully.");
}
```
## Step 3: Handle Missing License File
```csharp
else
{
Console.WriteLine("\nWe do not ship any license with this example. " +
"\nVisit the GroupDocs site to obtain either a temporary or permanent license. " +
"\nLearn more about licensing at https://purchase.groupdocs.com/faqs/licensing. " +
"\nLearn how to request temporary license at https://purchase.groupdocs.com/temporary-license.");
}

```
By following these steps, you'll be able to set the license from a file in your .NET application using GroupDocs.Viewer.

## Conclusion
In conclusion, GroupDocs.Viewer for .NET offers a seamless solution for integrating document viewing capabilities into your .NET applications. By following the steps outlined in this tutorial, you can easily set the license from a file and unlock the full potential of GroupDocs.Viewer.
## FAQ's
### How can I obtain a permanent license for GroupDocs.Viewer for .NET?
You can purchase a permanent license from [GroupDocs](https://purchase.groupdocs.com/buy) to use GroupDocs.Viewer without any limitations.
### Is a temporary license available for evaluation purposes?
Yes, you can request a temporary license from [here](https://purchase.groupdocs.com/temporary-license/) to evaluate GroupDocs.Viewer for .NET before making a purchase.
### Can I customize the appearance of the document viewer?
Yes, GroupDocs.Viewer for .NET provides extensive customization options to tailor the viewer according to your requirements.
### Does GroupDocs.Viewer support multiple document formats?
Yes, GroupDocs.Viewer supports a wide range of document formats including PDF, Microsoft Office, images, and more.
### Where can I find support for GroupDocs.Viewer for .NET?
You can find support and assistance on the [GroupDocs Viewer forum](https://forum.groupdocs.com/c/viewer/9).
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,73 @@
title: Set License from Stream
linktitle: Set License from Stream
second_title: GroupDocs.Viewer .NET API
description:
description: Enhance your .NET applications with GroupDocs.Viewer for seamless document viewing. Follow our step-by-step guide and integrate powerful document viewing capabilities effortlessly.
type: docs
weight: 11
url: /net/getting-started/set-license-from-stream/
---
## Introduction
Are you looking to empower your .NET applications with advanced document viewing capabilities? GroupDocs.Viewer for .NET offers a comprehensive solution to seamlessly integrate document viewing functionalities into your projects. In this tutorial, we'll delve into the process of leveraging GroupDocs.Viewer for .NET to enrich your applications with powerful document viewing capabilities.
## Prerequisites
Before we dive into the integration process, ensure that you have the following prerequisites in place:
1. Basic Knowledge of .NET Development: Familiarity with C# and .NET framework is essential to follow along with this tutorial.

2. GroupDocs.Viewer for .NET Package: Make sure you have downloaded and installed the GroupDocs.Viewer for .NET package. You can obtain it from the [download link](https://releases.groupdocs.com/viewer/net/).
3. Access to GroupDocs Documentation: Keep the [documentation](https://reference.groupdocs.com/viewer/net/) handy for reference during the integration process.

## Complete Source Code
## Import Namespaces
To begin with, import the necessary namespaces into your .NET application. Follow these steps:
### Step 1: Open your .NET project.
Ensure that you have your .NET project opened in your preferred development environment.
### Step 2: Add GroupDocs.Viewer Namespace.
In your code file, add the following namespace to access the GroupDocs.Viewer functionalities:
```csharp
using System;
using System.IO;

namespace GroupDocs.Viewer.Examples.CSharp.QuickStart
```
## Set License from Stream
The next step involves setting the license from a stream. Follow these detailed steps:
### Step 1: Define Output Directory.
Set the directory where your documents will be stored by defining the output directory:
```csharp
string outputDirectory = "Your Document Directory";
```
### Step 2: Check License File Existence.
Check if the license file exists in your project directory:
```csharp
if (File.Exists(Utils.LicensePath))
```
### Step 3: Set License.
If the license file exists, set the license using the provided stream:
```csharp
using (FileStream stream = File.OpenRead(Utils.LicensePath))
{
/// <summary>
/// This example demonstrates how to set license from stream.
/// </summary>
class SetLicenseFromStream
{
public static void Run()
{
if (File.Exists(Utils.LicensePath))
{
using (FileStream stream = File.OpenRead(Utils.LicensePath))
{
License license = new License();
license.SetLicense(stream);
}

Console.WriteLine("License set successfully.");
}
else
{
Console.WriteLine("\nWe do not ship any license with this example. " +
"\nVisit the GroupDocs site to obtain either a temporary or permanent license. " +
"\nLearn more about licensing at https://purchase.groupdocs.com/faqs/licensing. " +
"\nLear how to request temporary license at https://purchase.groupdocs.com/temporary-license.");
}
}
}
License license = new License();
license.SetLicense(stream);
}

```
### Step 4: Handle License Absence.
If the license file is not found, provide instructions to obtain a license:
```csharp
else
{
Console.WriteLine("\nWe do not ship any license with this example. " +
"\nVisit the GroupDocs site to obtain either a temporary or permanent license. " +
"\nLearn more about licensing at https://purchase.groupdocs.com/faqs/licensing. " +
"\nLearn how to request a temporary license at https://purchase.groupdocs.com/temporary-license.");
}
```

## Conclusion
Congratulations! You've successfully learned how to integrate GroupDocs.Viewer for .NET into your applications. With this powerful tool, you can now effortlessly view various document formats within your .NET projects, enhancing user experience and productivity.
## FAQ's
### Do I need a license to use GroupDocs.Viewer for .NET?
Yes, you need a license to use GroupDocs.Viewer for .NET. You can obtain either a temporary or permanent license from the GroupDocs website.
### Can I integrate GroupDocs.Viewer into my ASP.NET application?
Absolutely! GroupDocs.Viewer for .NET seamlessly integrates into both desktop and web applications, including ASP.NET.
### Which document formats are supported by GroupDocs.Viewer?
GroupDocs.Viewer supports a wide range of document formats, including PDF, Microsoft Office (Word, Excel, PowerPoint), images, and more.
### Is GroupDocs.Viewer compatible with .NET Core?
Yes, GroupDocs.Viewer for .NET is compatible with both .NET Framework and .NET Core.
### Can I customize the viewer interface according to my application's theme?
Yes, GroupDocs.Viewer provides extensive customization options, allowing you to tailor the viewer interface to match your application's theme seamlessly.
78 changes: 51 additions & 27 deletions content/english/net/getting-started/set-metered-license/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,65 @@
title: Set Metered License
linktitle: Set Metered License
second_title: GroupDocs.Viewer .NET API
description:
description: Enhance your .NET applications with GroupDocs.Viewer for seamless document viewing. Easily integrate document rendering functionalities into your projects.
type: docs
weight: 12
url: /net/getting-started/set-metered-license/
---
## Introduction
In the world of .NET development, incorporating powerful document viewing capabilities into your applications is essential for enhancing user experience and functionality. GroupDocs.Viewer for .NET offers a robust solution for seamlessly integrating document viewing functionalities into your .NET projects. Whether you're working with PDFs, Microsoft Office documents, or various image formats, GroupDocs.Viewer simplifies the process of rendering and displaying these documents within your applications.
## Prerequisites
Before diving into the implementation of GroupDocs.Viewer for .NET, ensure you have the following prerequisites in place:
### 1. Install GroupDocs.Viewer for .NET
To begin, you'll need to download and install GroupDocs.Viewer for .NET. You can find the download link [here](https://releases.groupdocs.com/viewer/net/). Follow the installation instructions provided to set up the library within your development environment.
### 2. Obtain Metered License
In order to utilize GroupDocs.Viewer for .NET, you need to obtain a metered license. This license allows you to control and monitor your API usage based on predefined quotas. Follow the steps below to set up your metered license:

## Complete Source Code
## Import Namespaces
First, ensure you import the necessary namespaces to access the functionality provided by GroupDocs.Viewer for .NET:
```csharp
using System;
```

namespace GroupDocs.Viewer.Examples.CSharp.QuickStart
Now, let's break down the example code provided into multiple steps:
## Step 1: Declare Public and Private Keys
Declare variables to store your public and private keys:
```csharp
string publicKey = "YOUR_PUBLIC_KEY";
string privateKey = "YOUR_PRIVATE_KEY";
```
Ensure to replace `"YOUR_PUBLIC_KEY"` and `"YOUR_PRIVATE_KEY"` with your actual keys.
## Step 2: Set Metered License
Check if the public key is provided. If not, prompt the user to set the keys:
```csharp
if (string.IsNullOrEmpty(publicKey))
{
/// <summary>
/// This example demonstrates how to set Metered license.
/// Learn more about Metered license at https://purchase.groupdocs.com/faqs/licensing/metered.
/// </summary>
class SetMeteredLicense
{
public static void Run()
{
string publicKey = "";
string privateKey = "";

if (string.IsNullOrEmpty(publicKey))
{
Console.WriteLine("\n[SetMeteredLicense] Please make sure to set Metered keys. Lear more at https://purchase.groupdocs.com/faqs/licensing/metered.");
return;
}

Metered metered = new Metered();
metered.SetMeteredKey(publicKey, privateKey);

Console.WriteLine("License set successfully.");
}
}
Console.WriteLine("\n[SetMeteredLicense] Please make sure to set Metered keys. Learn more at https://purchase.groupdocs.com/faqs/licensing/metered.");
return;
}

```
## Step 3: Initialize Metered Object and Set License
Initialize the Metered object and set the metered license using your public and private keys:
```csharp
Metered metered = new Metered();
metered.SetMeteredKey(publicKey, privateKey);
```
## Step 4: Confirmation Message
Display a confirmation message indicating that the license has been set successfully:
```csharp
Console.WriteLine("License set successfully.");
```

## Conclusion
In conclusion, GroupDocs.Viewer for .NET provides a comprehensive solution for incorporating document viewing functionalities into your .NET applications. By following the outlined steps, you can easily set up a metered license and start leveraging the capabilities of GroupDocs.Viewer within your projects.
## FAQ's
### Q: Where can I find documentation for GroupDocs.Viewer for .NET?
You can find the documentation [here](https://reference.groupdocs.com/viewer/net/).
### Q: Is there a free trial available for GroupDocs.Viewer for .NET?
Yes, you can access the free trial [here](https://releases.groupdocs.com/).
### Q: How can I obtain temporary licenses for testing purposes?
Temporary licenses can be obtained [here](https://purchase.groupdocs.com/temporary-license/).
### Q: Where can I seek support or ask questions related to GroupDocs.Viewer for .NET?
You can seek support and ask questions on the GroupDocs.Viewer forum [here](https://forum.groupdocs.com/c/viewer/9).
### Q: Where can I purchase a license for GroupDocs.Viewer for .NET?
You can purchase a license [here](https://purchase.groupdocs.com/buy).

0 comments on commit 3125ca4

Please sign in to comment.