Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Tue Jan 09, 2024 3:39 am

Hi guys,

I have encountered a strange issue with some legacy software I am supporting.
The comapny has been using the free version of Spire.Doc (v7.11) to produce docx files.
We have just come to the limitation that is the 500 paragraphs with the free version.
So we purchased a license and added the code to set the license key and load the license as per the documentation.
Everything is working fine, docs are being produced, images are being replaced, signature are added etc.
In some cases the docx files are loaded through Spire and then re-saved.
This is cause the strange issue, it seems as though the docx files that have been created prior to the license addition are being loaded and saved, but the watermark "Evaluation warning: The document was created with Spire.Doc for .NET".
We are thinking that we should be able to use files created by the free version if we have purchased a license?

- I cannot include a file (unless via email as the data is sensative)
- we are doing at the most simplist of things:
doc.LoadFromFile(wordDocPath);
//a little replacement code here
doc.SaveToFile(wordDocPath);
- docx files save with Spire.Doc (v7.11) then resaved after update and getting the license with Spire.Doc(9.4)
- windows server 2019
- web app .net 4.5

Any help would be greatly appreciated.

Regards,
Sam

ASFAudits
 
Posts: 2
Joined: Tue Dec 19, 2023 3:25 am

Tue Jan 09, 2024 6:14 am

Hello,

Thank you for your inquiry.
Based on your description, I conducted preliminary testing using SpireDocStandard 9.4.0 and was unable to reproduce the issue you mentioned. Attached is the code I used for my testing.
Code: Select all
 Spire.License.LicenseProvider.SetLicenseFileFullPath(@"F:\license.elic.xml");
 Document document = new Document();
 document.LoadFromFile("input.docx");
 document.Sections[0].AddParagraph().AppendPicture("input.jpg");
 document.SaveToFile("result.docx");

Additionally, I checked your purchase information and found that your license file only includes one project deployment address. If your project is deployed to two addresses, it might result in a warning watermark on the output files.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Wed Jan 10, 2024 3:18 am

Hello,

So I have managed to strip down the docx that we are using.
Please remember the method that was originally used was to get a word template (the stripped down one I have attached), replace some values, then save the docx, doing something like this:

var doc = new Spire.Doc.Document();
doc.LoadFromFile(fileName);
//do some "doc.Replace() calls here
doc.SaveToFile(newFileName);
doc.Close();

**Please note this was using the free version**
So we have a bunch of docx's sitting around that were created prior to the license being used.

Since purchasing the license we get the "newFileName" as from above (or basically the one that I have attached) and do the following (this is legacy code that I have no control over):

//this is the new code I have added to get and set the license key
var spireKey = ConfigurationManager.AppSettings["SpireLicenseKey"];
Spire.License.LicenseProvider.SetLicenseKey(spireKey);
Spire.License.LicenseProvider.LoadLicense();
//end of my new code

//start of legacy code
var doc = new Spire.Doc.Document();
doc.LoadFromFile(wordDocPath);
doc.Fields[0].Text = DateTime.Now.ToString("dd MMMM yyyy");
doc.SaveToFile(wordDocPath);
//end of legacy code

This then creates the water mark on the newly saved docx that was not there.

Cheers,
Sam

ASFAudits
 
Posts: 2
Joined: Tue Dec 19, 2023 3:25 am

Wed Jan 10, 2024 5:58 am

Hello,

Thank you for your feedback.
Based on the information you provided, I created a web project and conducted testing using the code and Word document you provided. However, the resulting output file did not contain a red warning watermark.
Attached is the test result file for your reference.
Furthermore, during my investigation, I examined your license file, and the KEY value range is "I9+Jt/zoEZ2......+nqSxuzsKctz". Please verify if the authorization key you used in your project matches the complete key value provided in the license.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.Doc

cron