Activate Aspose Words License

So we are using Aspose.Words to generate a word document. We have a template document file that we open, make changes to the document, and then save it out to the database as bytes. We then later retrieve those bytes from the database, activate the words license, and create a new document passing in the bytes (with a memory stream). This document is then displayed to the user.

We have a full license, and most of the time the document is shown without the “evaluation copy” message shown at the top and bottom of the document. However, randomly we see that message, and the document gets truncated.

Do you have any ideas on how to fix this? Do we need to activate the license when we first create the document from the template? This is how we are currently activating it:
-------------------------

String asposeLicFile = System.Configuration.ConfigurationManager.AppSettings["AsposeWordsLicenseFile"].ToString();

Aspose.Words.License lic = new Aspose.Words.License();
lic.SetLicense(asposeLicFile);

-------------------------

Thanks,
Tejash

Hi Tejash,
Thanks for your inquiry.
You need to set license before you instantiate any Document object. So have to activate the license before instantiating your template document. Please also make sure the input documents do not already have the evaluation message. Aspose.Words does not delete existing evaluation messages.
Please feel free to contact us for any further assitance.
Best Regards,