Inquiry Support for Character Spacing and Text Margin in Syncfusion PowerPoint (Presentation) Library

Dear Syncfusion Support,

I hope you’re doing well.

I’m currently working with the Syncfusion .NET PowerPoint (Presentation) library and have some questions regarding the availability of text formatting options—specifically related to character spacing and text box internal margins.


1. Character Spacing (Kerning / Tracking)

In Microsoft PowerPoint, there is an option to adjust Character Spacing (e.g., Loose, Very Tight, Custom spacing in pt). However, I’ve been unable to find an equivalent property or method in the Syncfusion Presentation library—such as on ITextPart, IFont, or IParagraph.

❓ Question:

Does the Syncfusion Presentation library currently support character spacing (i.e., kerning or tracking) adjustments for text elements in PowerPoint slides?


2. Text Box Internal Margins

I attempted to adjust internal margins using:

textboxShape.TextBody.MarginLeft = 100; textboxShape.TextBody.MarginRight = 100; textboxShape.TextBody.MarginTop = 100; textboxShape.TextBody.MarginBottom = 100;

However, I noticed no visible change in the output .pptx presentation file.

In contrast, when working with Syncfusion’s Word (DocIO) library, the following code works correctly and adjusts the internal margins of the text box as expected:

textboxShape.TextBoxFormat.InternalMargin.Top = 0; textboxShape.TextBoxFormat.InternalMargin.Bottom = 0; textboxShape.TextBoxFormat.InternalMargin.Left = 0; textboxShape.TextBoxFormat.InternalMargin.Right = 0;

This leads me to believe that either:

  • These TextBody.MarginX properties in the PowerPoint library are not currently implemented, or

  • There are specific conditions (e.g., shape types, units) where they apply

❓ Questions:

  • Are TextBody.MarginLeft/Top/Right/Bottom properties functional in the Presentation library?

  • If so, what units are used? Are there any known limitations or shape types where they apply correctly?


Attachment: image_f02e2b4f.png

3 Replies

SG Suresh Ganesan Syncfusion Team May 22, 2025 01:27 PM UTC

Hi Chanathip,
Regarding: Character spacing
Currently Presentation does not have support to “Expose API to apply the character spacing for PowerPoint text”. We have logged this as a feature request in our database. We don’t have any immediate plans to implement this feature. 

The status of the feature report can be tracked through the below link: 
Expose API to apply the character spacing for PowerPoint text in WinForms | Feedback Portal

Regarding: Text Box Internal Margins

Are TextBody.MarginLeft/Top/Right/Bottom properties functional in the Presentation library?

 

Yes, the TextBody.MarginLeft, MarginTop, MarginRight, and MarginBottom properties are fully functional in the Syncfusion Presentation Library.

Kindly refer the below code snippet:
//Creates PowerPoint Presentation

IPresentation pptxDoc = Presentation.Create();

//Adds slide to the PowerPoint

ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank);

//Adds textbox to the slide

IShape textboxShape = slide.AddTextBox(0, 0, 500, 500);

//Adds paragraph to the textbody of textbox

IParagraph paragraph = textboxShape.TextBody.AddParagraph();

//Adds a TextPart to the paragraph

ITextPart textPart = paragraph.AddTextPart();

textboxShape.TextBody.MarginLeft = 100;

textboxShape.TextBody.MarginRight = 100;

textboxShape.TextBody.MarginTop = 100;

textboxShape.TextBody.MarginBottom = 100;

//Adds text to the TextPart

textPart.Text = "AdventureWorks Cycles, the fictitious company on which the AdventureWorks sample databases are basedn is located.";

//Save the PowerPoint Presentation as stream

FileStream outputStream = new FileStream("Output.pptx", FileMode.Create);

pptxDoc.Save(outputStream);

//Closes the Presentation

pptxDoc.Close();

If so, what units are used? Are there any known limitations or shape types where they apply correctly?

 

All margin values are expressed in points (pt), similar to the values used in Microsoft PowerPoint. You can set margin values ranging from 0 to 1583. These margin settings apply correctly to all AutoShapes and text-containing shapes.

 

Regards,
Suresh Ganesan



CA Chanathip Amoncheewasilapakul May 23, 2025 01:49 AM UTC

Hi Suresh,

Thank you for the clarification regarding character spacing support in PowerPoint.

I’d like to ask a related question:
Is there currently any support in the Syncfusion Excel library (XlsIO) to apply character spacing to text in Excel cells? If not, could this also be considered for future implementation?

It would be useful for certain formatting scenarios, particularly when generating Excel reports with precise text layout requirements.

Please let me know if:

  • There is any existing workaround,

  • Any internal API supports it,

  • Or if this can be logged as a feature request (similar to PowerPoint).

Thanks again for your continued support.



SG Suresh Ganesan Syncfusion Team May 26, 2025 09:25 AM UTC

Chanathip,
Regarding Is there currently any support in the Syncfusion Excel library (XlsIO) to apply character spacing to text in Excel cells?”
We have branched the forum for that new query. Please find the details from the below forum.
Branched from ~ 196869 ~ Inquiry support for applying character spacing to text in Excel cells | Syncfusion Forum Assist



Loader.
Up arrow icon