EvotecIT / OfficeIMO

Fast and easy to use cross-platform .NET library that creates or modifies Microsoft Word (DocX) and later also Excel (XLSX) files without installing any software. Library is based on Open XML SDK
MIT License
280 stars 50 forks source link

Set special characters to the document's default font. #55

Closed eliseudev closed 1 year ago

eliseudev commented 1 year ago

Hello, I wanted to know if there's a way to set the default font for special characters for example, I put the default font in the "Segoe UI" document, but when it has a special character it stays with the "Calibri" font, how can I adjust it? Note, the font supports special characters. (follow the prints)

image

image

using (WordDocument document = WordDocument.Create(filePath))
                {
                    document.Settings.Language = "pt-Br";

                    string title = "INSTRUMENTO PARTICULAR DE CONSTITUIÇÃO DE GARANTIA DE\r\nALIENAÇÃO FIDUCIÁRIA DE IMÓVEL\r\n";

 document.AddParagraph(title).SetBold().ParagraphAlignment = JustificationValues.Center;
document.Save();

that's just the title, I need to adjust it in every document.

PrzemyslawKlys commented 1 year ago

I don't understand - why second issue?

eliseudev commented 1 year ago

Não entendo por que segunda questão?

Why didn't you answer the other one, can you help me?

PrzemyslawKlys commented 1 year ago

This is a free project. As such, I fix things when I have time, I answer when I have time. Nobody pays me to do it. I do it in my own free time.

eliseudev commented 1 year ago

Este é um projeto gratuito. Como tal, eu conserto as coisas quando tenho tempo, eu respondo quando tenho tempo. Ninguém me paga para fazer isso. Faço isso no meu próprio tempo livre.

Yes, I know, I'm sorry it's because I'm using it in a big project and it has no documentation, and I'm having this problem when it generates the word file.

eliseudev commented 1 year ago

Este é um projeto gratuito. Como tal, eu conserto as coisas quando tenho tempo, eu respondo quando tenho tempo. Ninguém me paga para fazer isso. Faço isso no meu próprio tempo livre.

If you could help me, I'd be grateful.

PrzemyslawKlys commented 1 year ago

I will take a look at it tomorrow or during the weekend.

eliseudev commented 1 year ago

I noticed that the generated document it opens in "compatibility mode", in which office version is it generated? is there a way I can set the version?

PrzemyslawKlys commented 1 year ago

It's not implemnented. Please open separate issue so it can be added, do not highjack other issues. It will require some investigation