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

Free Support Forum - aspose.com

Dynamically Placing Markers (Word Shapes) on top of images

Hi There,


We are using the Aspose Word product for some pretty complex stuff and it works great!

Our latest requirement has gotten a little tricky and I wanted to see if this type of stuff is possible and if so how to implement it.

As part of our Word template we have an image. We want to dynamically place markers on the image based on coordinates. We could do this by placing word shapes on top of the image.

Is this something we can do with Aspose?

Thanks!!

Matt

PS - I have attached an example of what I mean.

I guess this one is a toughy.


Is this possible?

Hi Matt,


Thanks for your inquiry and sorry for the delayed response. I think you can achieve placing shapes (images) on top of main image by using the code like below:

Document doc = new Document();

Shape sh1 = new Shape(doc, ShapeType.Rectangle);
sh1.FillColor = Color.Green;
sh1.Width = 200;
sh1.Height = 200;
sh1.WrapType = WrapType.None;

Shape sh2 = new Shape(doc, ShapeType.Rectangle);
sh2.FillColor = Color.Yellow;
sh2.Width = 20;
sh2.Height = 20;
sh2.Top = 100;
sh2.Left = 100;
sh2.WrapType = WrapType.None;
sh2.ZOrder = 2;

doc.FirstSection.Body.FirstParagraph.AppendChild(sh1);
doc.FirstSection.Body.FirstParagraph.AppendChild(sh2);

doc.Save(@“c:\temp\output.docx”);

I hope, this will help.

Best Regards,