We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Evaluation watermark is still appearing after applying license file

Aspose is used to generate and preview correspondence items. Both these functions are part of a WCF service. The correspondence Manager Service defines its constructor as follows:
#region Constructor
public CorrespondenceManagerService()
{
Aspose.Words.License license = new Aspose.Words.License();
license.SetLicense("Aspose.Words.lic");
}
#endregion
Preview function is called from an ASPX page. It returns a byte array which is then displayed inside of a browser window.
Generate function is called from a Microsoft Workflow Activity which is part of a workflow that is invoked from an ASPX page. This writes out a byte array to a database table which is picked up by another service and displayed in a browser page.
Both Preview and Generate are part of the CorrespondenceManagerService (WCF service). Aspose DLL is in the output folder of this service and so Apose.lic file.
Preview works great with no Evaluation watermark for the correspondence Document.
When the same document is processed using the Generate function, there is an Evaluation watermark on top of the document.
Both Preview and Generate use common functions which in turn call the MailMerge.Execute and MailMerge.ExecuteWithRegions on document object.

I have stepped thru the debugger and this constructor is called before both Preview and Generate functions.

Thanks

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Please check points described in FAQ (see “Licensing” section).

Also, note that you do not need to apply license each time when you call Aspose.Words API. You should set license once per Application domain. See the following link to learn when to apply license:

http://www.aspose.com/documentation/file-format-components/aspose.words-for-.net-and-java/when-to-apply-a-license.html

Best regards.

Hi Alexey

My first version used a static constructor on CorrespondenceManagerService

#region Constructor<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

static CorrespondenceManagerService()

{

Aspose.Words.License license = new Aspose.Words.License();

license.SetLicense("Aspose.Words.lic");

}

#endregion

I changed it because of the unusual behaviour that it was not getting picked up for the Generate function.

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I am not sure you have resolved the problem or not. Please let me know if you still have a problem, I will try to reproduce such behavior on my side.

Best regards,

I still have the issue. I read thru the link you had posted in your first reply and just wanted to let you know that I have tried to apply license as part of static construtor and a standard constructor. In both cases Preview has worked fine but not Generate.

Thanks

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Could you please attach your code here(whole class or simplified class)? I will try to reproduce the problem on my side.

Also, you can try to set license at the beginning of your method. This is not very good practice, but it should work.

Best regards.

I have tried to set the license at the beginning of Generate function with same result. I can try to send you the code but the difference between Preview and Generate is the following:

Preview - ASPX --- WCF --- ASPX

Generate - ASPX --- WCF -- WWF(workflow) --- WCF -- SQL Server

Will you be able to simulate workflow as well?

Thanks

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. I do not think that I need to use workflow to reproduce the problem. If I understood correctly, the documents are processed in WCF service and Aspose.Words is used only on service side. If so, I need only service code.

Best regards.

We have a resolution. The final webpage which displays the document uses Aspose to display the document in the browser. The license file was missing from there. Thank you very much for your prompt support.

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

It is nice that you have found the reason of the problem and resolved it.

Best regards.

I am useing Aspose.Total for generateing word document and have the same Issue.
After generateing Word file Evaluation watermark is still appearing. I am loaded Aspose.Total.lic file during appdomain start in Global.asax file.

the Aspose.Word runtime version is : v2.0.50727.

could anyone help on this?

here are the codes I useing:

=== Function Applying Lic file
public static void CreateAsposeLicense(String licFile)
{
License lic = null;
try
{
if (!String.IsNullOrEmpty(licFile))
{
lic = new License();
lic.SetLicense(licFile);
}
}
catch (Exception ex)
{
// Add log here
}
}
===

=== Word generation function
private static MemoryStream StremWithReplacementFile(byte[] buffer,string sFileName,Fm_Lm_Lead lead,Fm_Rw_Renewal renewal,Sys_User user)
{


MemoryStream stream = new MemoryStream(buffer);
try
{
Aspose.Words.Document doc = new Aspose.Words.Document(stream);

ReplaceFromMail(ref doc, lead, renewal, user);
stream.Close();
MemoryStream NewStream = new MemoryStream();

doc.Save(“c:\111.doc”); //Just tried to save on my HD to see if file is ok but not succed

doc.Save(NewStream, FormatWordToSave(sFileName));
NewStream.Seek(0, SeekOrigin.Begin);

return NewStream;

}
catch(Exception ex)
{
LogManager.Error("error in StremWithReplacementFile ", ex, typeof(MailSender));
return stream;
}

}
===

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Have you checked points described in FAQ (see “Licensing” section).

Best regards.

Hi,

Yes I checked. but it is not workeing. also I am useing Aspose.Total.Lic file for all Aspose components and I set Licence file when applications Starts, I think it’s enough because it’s workeing for Aspose.Cells but for Aspose.Word not workeing.

Thanks,
Vasil Mamikonyan

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

From your code, I see that you set license only once. However, you should set license for each Aspose product independently. For example:

//Set Aspose.Words License

Aspose.Words.License awLic = new Aspose.Words.License();

awLic.SetLicense("Aspose.Custom.lic");

//Set Aspose.Pdf license

Aspose.Pdf.License apLic = new Aspose.Pdf.License();

apLic.SetLicense("Aspose.Custom.lic");

Best regards.

Hi,
Thank you for your helpful answer it worked. But is it possible to add Licence for all Aspsoe components? because I have aspose.total.lic file which is for all Components, and I should add this file for all components.

Thanks again Alexey!

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Unfortunately, there is no way to set license for all Aspose products you are using. Anyway, you should set license for each Aspose product you are using.

Best regards.

Hi all!

Im receiving the this error when I try to set de pdf component license : "The license is not valid for this product."


Here is my code:

//set license

Aspose.Words.License license = new Aspose.Words.License();
license.SetLicense("Aspose.Custom.lic");

Aspose.Pdf.License pdfLicense = new Aspose.Pdf.License();
pdfLicense.SetLicense("Aspose.Custom.lic");

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. Each Aspose products have own license. Could you please check for which Aspose products your license is? To check this please, open the license file using notepad. You will see the following tags:

Aspose.Words

It means that the license is for Aspose.Words.

Best regards,