How to confirm valid license

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v7)  /  How to confirm valid license

DynamicPDF CoreSuite for .NET (v7) Forum

 Jun 13 2016 9:40 AM
My company has applications deployed in several different configurations and sometimes we miss adding a valid key to our config files.  When that happens we generate a lot of documents with watermarks and it is a pain to correct the documents after the fact.  How can I detect in code whether my license, or lack of one, is valid so that I can abort generating the document in the first place?
 Jun 13 2016 4:16 PM
Posted by a ceTe Software moderator
Hello,

You can detect whether a give license key is valid (for the server it is created) by adding the license in code as show below.
 
bool validLicense = Document.AddLicense("License Key Here");

In case you have multiple license keys for multiple servers in a load balancing environment where you are not sure which server will execute your code, you can call the AddLicense() method for all license keys and make sure at least one of the AddLicense() calls return true.

A scenario where it is not possible to detect the watermark ahead of time is if you use features or classes in your code that are not available in your licensed edition (for example, using enterprise features with a professional license). 

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 8:57 AM.