Free Support Forum -

Proper Image height & width is not comming

When i am exporting one HTML file into word, the Images height, weight is not comming in proper way in word file. But when i open that HTML file its comming.

How to over come this problem, give some suitable example.

Thanks & Regards


Thanks for your request. Unfortunately, html styles are not supported when importing into Aspose.Word. See the following document to learn more about converting format using Aspose.Words.

Also you can parse your html and insert your images as Shapes. See the following example.

Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

Shape shape = new Shape(doc, ShapeType.Image);

shape.WrapType = WrapType.Inline;


shape.ImageData.Borders[BorderType.Bottom].Color = Color.Black;

shape.ImageData.Borders[BorderType.Bottom].LineStyle = LineStyle.Single;

shape.ImageData.Borders[BorderType.Bottom].LineWidth = 2;

shape.ImageData.Borders[BorderType.Left].Color = Color.Black;

shape.ImageData.Borders[BorderType.Left].LineStyle = LineStyle.Single;

shape.ImageData.Borders[BorderType.Left].LineWidth = 2;

shape.ImageData.Borders[BorderType.Right].Color = Color.Black;

shape.ImageData.Borders[BorderType.Right].LineStyle = LineStyle.Single;

shape.ImageData.Borders[BorderType.Right].LineWidth = 2;

shape.ImageData.Borders[BorderType.Top].Color = Color.Black;

shape.ImageData.Borders[BorderType.Top].LineStyle = LineStyle.Single;

shape.ImageData.Borders[BorderType.Top].LineWidth = 2;



Best regards.