Hi Team,
I am trying to identify and extract all the shape coordinates from the word documents.
Below is the code snippet i used.
static void ExtractImageFromWord(string inputDoc)
{
Document doc = new Document(inputDoc);
LayoutCollector layout = new LayoutCollector(doc);
foreach (Shape shape in doc.GetChildNodes(NodeType.Shape, true))
{
var width = shape.Bounds.Width;
var height = shape.Bounds.Height;
var x = shape.Bounds.X;
var y = shape.Bounds.Y;
var pageNo = layout.GetStartPageIndex(shape);
}
}
Width and height fields are correctly populated, whereas X and Y values are always set 0. I have tried with many sample documents and all the docs have same behavior.
Can you please let me know how to properly get the shape coordinates?