I use temporary GroupDocs.Viewer for .NET license. When I run it, I still see the watermark license message on the viewer page. In my code, I have already added ‘var licensePath = @“GroupDocs.Viewer.lic”’. Could you please advise what I should do?
To resolve the issue of the watermark message appearing despite using a temporary license in your GroupDocs.Viewer for .NET project, please ensure you are following these steps:
-
Check License File Path: Make sure that the path to your license file is correct. The line in your code should point to the exact location of the
GroupDocs.Viewer.lic
file. If the file is not found, the license will not be applied. -
Set License in Code: You need to set the license in your application code. Here’s a sample implementation:
using System; using System.IO; using GroupDocs.Viewer; class Program { static void Main(string[] args) { var licensePath = @"GroupDocs.Viewer.lic"; // Ensure this path is correct if (File.Exists(licensePath)) { License license = new License(); license.SetLicense(licensePath); Console.WriteLine("License set successfully."); } else { Console.WriteLine("License file not found. Please check the path."); } } }
-
Verify License File: Ensure that the license file is valid and has not expired. If you are using a temporary license, confirm that it is still active.
-
Check for Exceptions: Look for any exceptions or errors in your application that might indicate issues with loading the license file.
-
Consult Documentation: For further details, you can refer to the official documentation on setting the license from a file, which provides additional insights and examples.
By following these steps, you should be able to successfully apply the temporary license and remove the watermark from the viewer. If the issue persists, consider checking the GroupDocs support forum for similar issues or additional assistance.
Sources:
[1]: Set License from File | GroupDocs.Viewer .NET API - Aspose