We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Hanging Indent for multi-line bullet list in PPT

Thread ID:

Created:

Updated:

Platform:

Replies:

145276 Jun 14,2019 05:31 PM UTC Jun 20,2019 06:10 PM UTC ASP.NET Core - EJ 2 2
loading
Tags: Presentation
Rohit
Asked On June 14, 2019 05:31 PM UTC

We have a requirement in our project where bullet list is not aligning correctly as MS PPT does.

Problem is when the text exceeds one line in a list, the new line will start right below the bullet and not at the beginning of the text. We need the new line to be aligned right below the first line text as shown below:

• Turned off call to get the breakfast from Wendy's

Launch date:  4/8, 4/18, 4/22


Need Launch date to come below the Turned off call text like this: 


• Turned off call to get the breakfast from Wendy's

          Launch date:  4/8, 4/18, 4/22


Vijayasurya Anandhan [Syncfusion]
Replied On June 19, 2019 01:54 PM UTC

Hi Rohit,

Thank you for contacting Syncfusion support.

On further analysis, it is possible to meet your requirement using our Essential PowerPoint library.

In Essential PowerPoint library, if the text with bullet exceeds the first line, then the next line will start right below the bullet. To make the next line start right below the first line text, please use the below code snippet.


 
//Creates a new Presentation instance. 
IPresentation pptxDoc = Presentation.Create(); 
 
//Adds a blank slide into the Presentation 
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank); 
 
// Adds a textbox to hold the list 
IShape textBoxShape = slide.AddTextBox(65, 140, 410, 100); 
 
// Adds a new paragraph with the text in the left-hand side textbox. 
IParagraph paragraph = textBoxShape.TextBody.AddParagraph("Turned off call to get the breakfast from Wendy's Launch date: 4 / 8, 4 / 18, 4 / 22"); 

//Sets the list type as Numbered
 
paragraph.ListFormat.Type = ListType.Numbered; 
 
//Sets the numbered style (list numbering) as Arabic number following by period. 
paragraph.ListFormat.NumberStyle = NumberedListStyle.ArabicPeriod; 
 
//Sets the starting value as 1 
paragraph.ListFormat.StartValue = 1; 
 
//Sets the list level as 1 
paragraph.IndentLevelNumber = 1; 
 
// Sets the hanging value 
paragraph.FirstLineIndent = -20; 

//Create new instance of memory stream 
MemoryStream outputStream = new MemoryStream(); 
 
//Save the Presentation 
pptxDoc.Save(outputStream); 
 
outputStream.Position = 0; 
 
//Closes the Presentation 
pptxDoc.Close(); 
  
Please find the API details below as follows:

IndentLevelNumber
:

This API is used to Get/Set the indent level of the paragraph, where paragraph with Indent level - 0  indicated paragraph with no indentation.

FirstLineIndent:
This API is used to Get/Set the first line indent of the paragraph in points. This API will be used for both hanging indent and first line indent. If you set negative values, it will act as hanging indent to the paragraph. If you set positive value, it will act as first-line indent to the paragraph.

When we set the indent level number to the paragraph and set the first line indent, then the entire paragraph will use the value of the first line indent.

We have created a sample to meet your requirement, which can be downloaded from the below link.
http://www.syncfusion.com/downloads/support/directtrac/239416/ze/ListSample-251043653.zip

Please let us know if you have any queries.


Regards,
Vijayasurya A



Rohit
Replied On June 20, 2019 06:10 PM UTC

Thank you guys...This works like a charm.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon