Hello,
I am using the below code to convert a html to docx document, word is not respecting the height and width of the div boxes. How can i export div boxes with their respective dimensions.
input html
image.png (184 Bytes)
output word
image.png (11.9 KB)
code i used:
Aspose.Words.License lic = new Aspose.Words.License();
lic.SetLicense("Aspose.Total.Product.Family.lic");
string inputHtml = @"<html>
<head>
<style type='text/css'>.box{width:50px;height:50px}.red{background:#f00}.green{background:#0f0}.blue{background:#00f}</style>
</head>
<body>
<div>
<div class='box red'></div>
<div class='box green'> </div>
<div class='box blue'> </div>
</div>
</body>
</html>";
var destinationDoc = new Document();
var builder = new DocumentBuilder(destinationDoc);
builder.InsertHtml(inputHtml);
destinationDoc.UpdatePageLayout();
destinationDoc.Save("output.docx", SaveFormat.Docx);
Console.WriteLine("Done");
Console.ReadKey();
Thanks,
Lalitya