Hi,
My primary objective is to define the thickness of the ‘line’ shape.
Below is my code snippet.
DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToHeaderFooter(HeaderFooterType.FooterPrimary);
Shape[] omrLine = new Shape[10];
for (int i = 0; i < 9; i++)
{
omrLine[i] = new Shape(doc, ShapeType.Line);
omrLine[i].Rotation = 90;
omrLine[i].Top = 10;
omrLine[i].Left = i * 10;
omrLine[i].Width = 20;
omrLine[i]. = 12;
omrLine[i].StrokeColor = Color.Red;
omrLine[i].WrapType = WrapType.None;
omrLine[i].BehindText = true;
builder.InsertNode(omrLine[i]);
}
I discovered the property called ‘SizeInPoints’ but this property is a read only.
Regards,
hadi teo
Hi Hadi,
Thanks for your inquiry. Please use the Stroke.Weight Property to defines the brush thickness that strokes the path of a shape in points. Please read following documentation link for your kind reference:
https://reference.aspose.com/words/net/aspose.words.drawing/stroke/
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToHeaderFooter(HeaderFooterType.FooterPrimary);
Shape[] omrLine = new Shape[10];
for (int i = 0; i < 9; i++)
{
omrLine[i] = new Shape(doc, ShapeType.Line);
omrLine[i].Rotation = 90;
omrLine[i].Top = 10;
omrLine[i].Left = i * 50;
omrLine[i].Width = 20;
omrLine[i].StrokeColor = Color.Red;
omrLine[i].WrapType = WrapType.None;
omrLine[i].BehindText = true;
omrLine[i].Stroke.LineStyle = ShapeLineStyle.ThickThin;
omrLine[i].Stroke.Weight = 5;
builder.InsertNode(omrLine[i]);
}
doc.Save(MyDir + "AsposeOut.docx");
Hi,
Thanks very much for your assistance. Your suggestion is working well. This is the property that i am looking for.
Regards,
hadi teo
Hi Hadi,
Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.