Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.

Thu May 04, 2017 4:50 pm

I want to have indentation between bullet points. I dint find any suitable property for the same.

stp_webdev
 
Posts: 15
Joined: Fri Apr 21, 2017 1:40 pm

Fri May 05, 2017 7:47 am

Dear stp_webdev,

Thanks for your inquiry.
Please try to use following code.
Code: Select all
shape.TextFrame.Paragraphs[0].LeftMargin = 100;

If there is still the issue, please provide us with your input file and the expected result file(you can generate it by MS PowerPoint) for investigation.


Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Mon May 08, 2017 3:33 pm

What about space between bullet points? Like space between 1st and 2nd bullet points.

stp_webdev
 
Posts: 15
Joined: Fri Apr 21, 2017 1:40 pm

Tue May 09, 2017 2:13 am

Dear stp_webdev,

Thanks for your information.
please try to use following method.
Code: Select all
shape.TextFrame.Paragraphs[1].SpaceBefore = 200;

If it is not what you expect, please provide us with your input file and the expected result file(you can generate it by MS PowerPoint) showing your requirement. Then we will provide the corresponding code.

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri May 12, 2017 1:33 pm

Hi,

Please find the attachments. You will understand the requirement.

Thank you
Dibyalochan Nayak

stp_webdev
 
Posts: 15
Joined: Fri Apr 21, 2017 1:40 pm

Mon May 15, 2017 7:22 am

Dear Dibyalochan,

Thanks for your feedback.
I got it. You could give the SpaceBefore smaller value to decrease the space in the screenshot. Did you do that ?
In addition, the vertical distance of two points depends on SpaceBefore, SpaceAfter and LineSpacing. Maybe you could set them.
Code: Select all
            shape.TextFrame.Paragraphs[1].SpaceBefore = 0;
            //shape.TextFrame.Paragraphs[1].SpaceAfter = 0;
            //shape.TextFrame.Paragraphs[1].LineSpacing = 0.9f;

Hope this helps. If you still have issue, please provide us with input/expected files instead of screenshot for investigation.

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri May 19, 2017 12:38 pm

Hi,

Your suggestion is not working for me.

I have attached the image for your reference.

stp_webdev
 
Posts: 15
Joined: Fri Apr 21, 2017 1:40 pm

Mon May 22, 2017 6:15 am

Hello,

Sorry for late reply as weekend. Please try to go through all of the paragraph objects, and set their indent as same value. Hope it helps.
Code: Select all
 for (int i = 0; i < shape.TextFrame.Paragraphs.Count; i++)
                {
                      shape.TextFrame.Paragraphs[i].Indent = 10;
                }


Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Thu May 25, 2017 3:42 pm

Hi,

The suggestion you have provided is not working for me.If you see the image all the lines are in a single paragraph and from the second lines on wards the lines are not getting indented as expected.

stp_webdev
 
Posts: 15
Joined: Fri Apr 21, 2017 1:40 pm

Fri May 26, 2017 1:44 am

Hello,

Please attach the document you were trying here for investigaiton further or send it to us([email protected]) via email, we will work out the solution accordingly.

Thanks,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Fri May 26, 2017 4:58 pm

Hi,

Below is the code I am using for creating bullet-ed paragraph but I am unable indent the paragraph from second line onwards.I have also attached the images for expected output.

RectangleF qdt_reportContent = new RectangleF(370, 150, presentation.SlideSize.Size.Width / 2 - 50, 130);
IAutoShape shape_qdtContent = presentation.Slides[report_count - 1].Shapes.AppendShape(ShapeType.Rectangle, qdt_reportContent);
shape_qdtContent.Line.FillType = FillFormatType.None;
string[] str = new string[] { "Divergence between non-US and US", "Large currency impact.: XXXX XXXX Index returned +X.0X% in local currency terms but -X.XX% in US dollar terms.", "This marked the fourth consecutive year of loss for the trade weighted US dollar index.", "Emerging Markets were down X.XX% presumably reflecting negative sentiment for outsourcing and potential for deteriorating trading relationships." };
foreach (string txt in str)
{
TextParagraph textParagraph = new TextParagraph();
textParagraph.Text = txt;
textParagraph.Alignment = TextAlignmentType.Left;
textParagraph.LeftMargin = 5;
textParagraph.TextRanges[0].Fill.FillType = FillFormatType.Solid;
textParagraph.TextRanges[0].FontHeight = 12;
textParagraph.TextRanges[0].LatinFont = new TextFont("Calibri Light");
//set the Bullets
textParagraph.BulletType = TextBulletType.Symbol;
textParagraph.BulletStyle = NumberedBulletStyle.BulletSimpChinPeriod;
shape_qdtContent.TextFrame.Paragraphs.Append(textParagraph);
shape_qdtContent.Fill.FillType = FillFormatType.None;
textParagraph.Indent = 15f;

}

stp_webdev
 
Posts: 15
Joined: Fri Apr 21, 2017 1:40 pm

Mon May 29, 2017 6:09 am

Hello,

Thanks for your codes. By investigation further, it needs to set the special value for indentation in paragraph as hanging when indent the paragraph from second line onwards, but sorry that now the value can't be set, and I have posted it to our Dev team, once it is resolved, or we have some other update, we will let you know ASAP, sorry for incovnenience.

Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Thu Jun 01, 2017 2:30 am

Hello,

Thanks for your waiting. After investigation more, as per your requirement, it needs to set the following values.
Code: Select all
textParagraph.HangingPunctuation = TriState.True;
textParagraph.Indent = -15f;
textParagraph.LeftMargin = 15f;

Here is full test codes for your reference.
Code: Select all
       Presentation presentation = new Presentation();
        RectangleF qdt_reportContent = new RectangleF(370, 150, presentation.SlideSize.Size.Width / 2 - 50, 130);
        IAutoShape shape_qdtContent = presentation.Slides[0].Shapes.AppendShape(ShapeType.Rectangle, qdt_reportContent);
        shape_qdtContent.Line.FillType = FillFormatType.None;
        string[] str = new string[] { "Divergence between non-US and US", "Large currency impact.: XXXX XXXX Index returned +X.0X% in local currency terms but -X.XX% in US dollar terms.", "This marked the fourth consecutive year of loss for the trade weighted US dollar index.", "Emerging Markets were down X.XX% presumably reflecting negative sentiment for outsourcing and potential for deteriorating trading relationships." };
        foreach (string txt in str)
        {
            TextParagraph textParagraph = new TextParagraph();
            textParagraph.Text = txt;
            textParagraph.Alignment = TextAlignmentType.Left;
            textParagraph.TextRanges[0].Fill.FillType = FillFormatType.Solid;
            textParagraph.TextRanges[0].FontHeight = 12;
            textParagraph.TextRanges[0].LatinFont = new TextFont("Calibri Light");
            //set the Bullets
            textParagraph.BulletType = TextBulletType.Symbol;
            textParagraph.BulletStyle = NumberedBulletStyle.BulletSimpChinPeriod;
       
            //need to do this.
            textParagraph.HangingPunctuation = TriState.True;
            textParagraph.Indent = -15f;
            textParagraph.LeftMargin = 15f;
           
            shape_qdtContent.TextFrame.Paragraphs.Append(textParagraph);
            shape_qdtContent.Fill.FillType = FillFormatType.None;
        }
        presentation.SaveToFile("SetParagraphFormatting.pptx",FileFormat.Pptx2007);

Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Wed Jun 07, 2017 9:19 am

Dear Dibyalochan,

Did you test the code provided by Gary ? Has it solved your issue ?
Could you please give us some feedback at your convenience ?

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Sun Oct 07, 2018 7:15 pm

Betsy.jiang wrote:Dear Dibyalochan,

Did you test the code provided by Gary ? Has it solved your issue ?
Could you please give us some feedback at your convenience ?

Sincerely,
Betsy
E-iceblue support team


Hi,

I've used the code provided and it's working fine thanks.

Code: Select all
textParagraph.Indent = -15f;
textParagraph.LeftMargin = 15f;

bfataftah
 
Posts: 3
Joined: Mon May 14, 2018 4:49 pm

Return to Spire.Presentation

cron