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

Free Support Forum - aspose.com

How to set a custom size on bullet?


Is there a way to set a default size on the bullets? In a way that is independent of the portions, I mean? I tried something, but the size of bullet is proportional to size of text in the portion. I want to make it independent of the size of portion.

I have attached the code sample and the image of the output here.

Please help me. Thanks in advance.

Code Sample:

m_secondPresentation = new Presentation();
var autoShape = m_secondPresentation.Slides[0].Shapes.AddAutoShape(ShapeType.Rectangle, 0, 0, m_secondPresentation.SlideSize.Size.Width, m_secondPresentation.SlideSize.Size.Height);
autoShape.UseBackgroundFill = true;
autoShape.UseBackgroundFill = true;
var frame = autoShape.TextFrame;
var somePara = new Paragraph();
somePara.ParagraphFormat.Bullet.Type = BulletType.Symbol;
somePara.ParagraphFormat.Bullet.IsBulletHardColor= NullableBool.False;
somePara.ParagraphFormat.Bullet.IsBulletHardFont = NullableBool.False;

        var point1 = new Portion("some Point1");
        var point2 = new Portion(" some Point2");

        point2.PortionFormat.FontBold = NullableBool.True;

        var newline = new Portion("\n");
        var portion3 = new Portion("portion with no bold");
        portion3.PortionFormat.FontHeight = 40.0f;

        somePara.ParagraphFormat.SpaceBefore = -3.5f;
        somePara.ParagraphFormat.SpaceAfter = -3.5f;
        somePara.ParagraphFormat.SpaceWithin = -12.0f;

bullet-example.PNG (4.3 KB)


I have observed your comments. I like to inform that you can set height of the bullet using BulletFormat.setHeight(). It returns or sets the bullet height of a paragraph with no inheritance, Value float.NaN determines that bullet inherits height from the first portion in the paragraph. You could set to NaN if would like same size as portion of paragraph and vice versa. Please share feedback with us if there is still an issue.

1 Like