We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Can you set this property spacing directly in the paragraph?Or better?

I know this property spacing in the font. I know that it can be accessed by run(run.Font.Spacing) in the paragraph. If use run this way, need to loop many times. Can you set this property spacing directly in the paragraph?Or better?

@lovecomputer

Please note that formatting is applied on a few different levels. For example, let’s consider formatting of simple text. Text in documents is represented by Run element and a Run can only be a child of a Paragraph. You can apply formatting

  1. to Run nodes by using Character Styles e.g. a Glyph Style.
  2. to the parent of those Run nodes i.e. a Paragraph node (possibly via paragraph Styles).
  3. you can also apply direct formatting to Run nodes by using Run attributes (Font). In this case the Run will inherit formatting of Paragraph Style, a Glyph Style and then direct formatting.

You can modify the style of document as shown below to set the spacing between characters. You can also iterate over paragraph nodes and get paragraph style ParagraphFormat.Style property and modify it according to your requirement. Hope this helps you.

Document doc = new Document(MyDir + "input.docx");
doc.Styles[StyleIdentifier.Normal].Font.Spacing = -1;
doc.Save(MyDir + "Font.ScalingSpacing.docx");