facebooktwittermenuarrow-up

GemBox Support Forum

How to set Expanded in Spacing

Hello,
How can I change spacing between words ?
I would like use Expanded option as there

Hi Max,

Note that this expanding or condensing is not between words, instead, it is between each letter.

Nevertheless, try setting the CharacterFormat.Spacing property like the following:

var document = new DocumentModel();

var run = new Run(document, "Sample text.");
run.CharacterFormat.Spacing = 10;

document.Sections.Add(
    new Section(document,
        new Paragraph(document, run)));

document.Save(desktop + "\\output.docx");

Also, please check the Character Formatting example.

I hope this helps.

Regards,
Mario

Could you please add this feature ?

Hi,

What feature?

As you can see from the provided snippet code, GemBox.Document already supports the expanded option that you linked…

Regards,
Mario

I mean the lenght between letters
Client example for reproduce:
image

Okey, I have found a solution

ParagraphFormat.Alignment = HorizontalAlignment.Justify;

Hi Max,

I’m glad you were able to solve this.

Just as an FYI, that is a different option:

Regards,
Mario