Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Tue Sep 27, 2022 10:45 pm

Hello,

I'm trying to draw a colour filled circular shape on my document to act as a coloured bullet point.

My issue is that the AppendShape method does not appear to either have the exact shape I'm looking for or if use something like ShapeType.Pie (which sounded like the shape that would most likely give me what I need) nothing renders on the page.

Other shape types like arrow, rectangle etc do appear when I use them but there are a few that don't seem to do anything.

Can you advise as to why this might be happening? Here is my code snippet:

Code: Select all
var paragraph = docSection.AddParagraph();
var shape = paragraph.AppendShape(50f, 50f, ShapeType.Pie);
shape.StrokeColor = Color.Red;
shape.FillColor = Color.Red;


Alternatively, if I am going about this the wrong way can you suggest an easier or better way to achieve a way to create styled bullet points with size/colour etc.

Thank you,
Zac

ZCliff92
 
Posts: 28
Joined: Thu Jan 20, 2022 1:58 am

Wed Sep 28, 2022 7:42 am

Hello Zac,

Thanks for your inquiry.
According to your description, do you want to achieve the effect shown in the screenshot below? If so, you need to use “ShapeType.Ellipse” to achieve your requirement. I put the complete code snippet below for your reference.
If you have any issue, just feel free to contact us.

Code: Select all
 Document doc = new Document();
            Section docSection = doc.AddSection();
            var paragraph = docSection.AddParagraph();
            ShapeObject shape = paragraph.AppendShape(50f, 50f, ShapeType.Ellipse);


Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 860
Joined: Tue Mar 08, 2022 2:02 am

Return to Spire.Doc