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.

Mon Jun 06, 2011 12:45 pm

Hi

I'm using Spire.DOC on a webserver. My word template has german as language. Everytime when i open/modify and stream the document to the client the language of text has changed to english.
The problem is the field '{ DATE \@ "d. MMMM yyyy" \* MERGEFORMAT }' which will be displayed as '6. June 2011' (english) instead of '6. Juni 2011' (german).

Any help?

Best regards,
Hubert

softecregistrierung
 
Posts: 22
Joined: Mon Mar 07, 2011 9:35 am

Tue Jun 07, 2011 3:23 am

Dear softecregistrierung,
Thanks for your inqury. Please upload your template and a simple demo. So that we can test it.
Justin
Technical Support / Developer,
e-iceblue Support Team
User avatar

Justin Weng
 
Posts: 110
Joined: Mon Mar 28, 2011 5:54 am

Tue Jun 07, 2011 8:56 am

Please find attached the template and the result and below some sample code.
Thanks in advance,
Hubert

Code: Select all
byte[] data = from the database loaded...
string filename = "Result.docx";

Document document = new Document();
using (MemoryStream ms = new MemoryStream(data))
{
    document.LoadFromStream(ms, FileFormat.Auto);
}

... some simple replacement

using (MemoryStream ms = new MemoryStream())
{
    document.SaveToStream(ms, FileFormat.Docx);
   
    Response.Clear();
    Response.ContentType = "application/x-msword";
    Response.AddHeader("Content-Type", "application/x-msword");
    Response.AddHeader("Content-Disposition", "attachment; filename={0}".FORMAT(Server.UrlEncode(fileName)));
    Response.OutputStream.Write(data, 0, data.Length);
    Response.Flush();
    Response.End();
}

softecregistrierung
 
Posts: 22
Joined: Mon Mar 07, 2011 9:35 am

Wed Jun 08, 2011 4:16 am

It's your template setting problem. You should set German as Default language. You can see the upload picture to set default language.
Justin
Technical Support / Developer,
e-iceblue Support Team
User avatar

Justin Weng
 
Posts: 110
Joined: Mon Mar 28, 2011 5:54 am

Wed Jun 08, 2011 5:06 am

Thank you very much for the solution.
Do you have any idea why it is not working with 'German (Switzerland)' (should be the same)?

Best regards,
Hubert

softecregistrierung
 
Posts: 22
Joined: Mon Mar 07, 2011 9:35 am

Thu Jun 09, 2011 1:40 am

Dear Hubert,
IMO, you set the template default language, so that the result files language to be the same.
The result files language based on template. If not, the result files language will be MS Word default language(US-English).
Justin
Technical Support / Developer,
e-iceblue Support Team
User avatar

Justin Weng
 
Posts: 110
Joined: Mon Mar 28, 2011 5:54 am

Return to Spire.Doc