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.

Fri Nov 16, 2012 2:25 pm

Hi,

Using Spire.Doc to change word doc file.
Then we need this file to be saved as .doc and .pdf.

After inserting watermark in doc file stoped to open properly - World starts to display scurity alarm (see attached file).

Have a nice day.

kriskm59
 
Posts: 11
Joined: Mon Oct 17, 2011 1:32 pm

Mon Nov 19, 2012 8:28 am

Hi,

Thanks for your inquiry.
We are sorry for the delay response for the weekends here. We have reproduced your problem. We are sorry for the inconvenience. I have forwarded it to our Develop team. They will fix the problem soon. Once the problem has been fixed, we will inform you immediately. Also spire.doc can support saving a .doc file as a .docx file. We suggest you to save the doc file which has been added watermark as a .docx file. We provide you some sample code. Please try that, and tell us your test result. Thank you!
Code: Select all
Document document = new Document(originalDocFile);
InsertWatermark(document.Sections[0]); // add a watermark to doc file
document.SaveToFile(fileNameDocx,FileFormat.Docx); // save document as a Docx format document
//document.SaveToFile(fileNameDocx, FileFormat.Docx2010); //save document as a Docx2010 format document


Best regards,
Amy
E-iceblue support
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Tue Nov 20, 2012 2:32 pm

Thank You for your answer. Unfortunately when I save docx file I have got an error (see attachments). I attach docx and doc files.

In next post I will send You doc & docx files.

Best regards,
Krzysztof Koziarski

kriskm59
 
Posts: 11
Joined: Mon Oct 17, 2011 1:32 pm

Tue Nov 20, 2012 2:35 pm

doc & docx files.

kriskm59
 
Posts: 11
Joined: Mon Oct 17, 2011 1:32 pm

Wed Nov 21, 2012 6:42 am

Hi,

Thanks for your feedback.
We unpacked your document and found that in the style.xml, the decimal separator is ",", not the standard ".". It was caused by a globalization bug of spire.doc. We use the number format style of local culture, not the standard format. We are sorry for the inconvenience. We will improving spire.doc to support the featrue in the future. Now we provide you a method to resolve the problem of decimal separator. Please try it, and tell us how it works. If you still have the problem, could you please provide us your original doc file which you want to insert watermark and your code? So that we can reproduce your problem, and work out a solution for you again. Thank you!
Code: Select all
       static void Main(string[] args)
       {
            Document documentdoc = new Document(originalDocFile);

            InsertWatermark(documentdoc.Sections[0]);

            CultureInfo cc = Thread.CurrentThread.CurrentCulture;
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

            documentdoc.SaveToFile(@"sample2003.doc", FileFormat.Doc);
            documentdoc.SaveToFile(@"sample2007.docx", FileFormat.Docx);
            //documentdoc.SaveToFile(@"sample2010.docx", FileFormat.Docx2010);

            Thread.CurrentThread.CurrentCulture = cc;
      }


Best regards,
Amy
E-iceblue support
Last edited by amy.zhao on Thu Nov 22, 2012 7:22 am, edited 2 times in total.
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Wed Nov 21, 2012 9:47 am

Thanks for your help.
Now it's ok.

Best regards,
Krzysztof Koziarski

kriskm59
 
Posts: 11
Joined: Mon Oct 17, 2011 1:32 pm

Thu Nov 22, 2012 3:24 am

Hi Krzysztof Koziarski,

You are welcome.
If you encounter any problem, please feel free to contact us.

Best regards,
Amy
E-iceblue support
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.Doc

cron