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

Free Support Forum - aspose.com

How I can add a drawing canvas to a document

Hi - I’m interested in using Aspose.Words for generating customized reports, so am trying to get a better understanding of some features.

One specific question I have right now is how I can add a drawing canvas to a document?

I have searched the help files etc. but can’t see any explicit references to drawing canvas objects.

I need to create diagrams where I add a large number of drawing shapes to a canvas

the reason I prefer to use a canvas is because that enables me to control the x/y coordinates of the shapes of my diagram more easily. I can use the canvas as the reference point for the parameters.

This message was posted using Email2Forum by Tahir Manzoor.

Hi Steven,

Thanks for your inquiry. Unfortunately, Aspose.Words does not support the requested feature at the moment. However, I have logged this feature request as WORDSNET-10552 in our issue tracking system. You will be notified via this forum thread once this feature is available. We apologize for your inconvenience.

I suggest you please use the GroupShape to achieve your requirements. Please check the following code example for your kind reference.

Document doc = new Document();
GroupShape gs = new GroupShape(doc);
Shape rectangle = new Shape(doc, ShapeType.Rectangle);
rectangle.Height = 100;
rectangle.Width = 100;
rectangle.WrapType = WrapType.Square;
rectangle.Left = 0;
rectangle.Top = 0;
Shape triangle = new Shape(doc, ShapeType.Triangle);
triangle.Height = 100;
triangle.Width = 100;
triangle.WrapType = WrapType.Square;
triangle.Left = 100;
triangle.Top = 0;
gs.AppendChild(rectangle);
gs.AppendChild(triangle);
gs.Width = 200;
gs.Height = 200;
DocumentBuilder builder = new DocumentBuilder(doc);
builder.InsertNode(gs);
doc.Save(MyDir + "Out.docx");