Text over image

Hello


I am trying to convert an html document to an image. However I want to overlay some text over the image as it is easier to manipulate it. Does your software cater for this. I have attached the sample HTML.

Regards,
Simon

<div style=“color: rgb(212, 212, 212); background-color: rgb(30, 30, 30); font-family: Consolas, “Courier New”, monospace; font-size: 14px; line-height: 19px; white-space: pre;”>
<html>

<head>
<style>
.image {
position: relative;
width: 750;
}

h2 {
position: absolute;
top: 5;
left: 10;
width: 750;
}
</style>
</head>

<body>

<table style=“width: 100%”>
<tr>
<td colspan=“3”>
<div class=“image”>
<img src=“image.png” style=“width: 750px; height: 112px” />
<h2>[OVERLAYTEXT]</h2>
</div>
</td>
</tr>
</table>

</body>

</html>
Hi Simon,

Thanks for your inquiry. Please note that Aspose.Words mimics the same behavior as MS Word does. If you open this HTML in MS Word and convert it to fixed file format e.g. PDF, you will get the same output.

However, we have logged this feature request as WORDSNET-15385 in our issue tracking system. Our product team will look into the possibility of implementation of this feature. Once we have any information about this feature, we will update you via this forum thread.

Please let us know if you have any more queries.

@simonm-1,

Thank for your patience. Please note that Aspose.Words mimics the behavior of MS Word. It is to update you that we have closed the issue (WORDSNET-15385) with “Won’t Fix” resolution.

Absolutely positioned paragraphs are not supported during import from HTML, because there is no counterpart for them in our document model. As a workaround, the you can make the image absolutely positioned and place it behind text using the “z-index” CSS property as shown below.

<img src=“image.png” style=“width: 750px; height: 112px; position: absolute; z-index: -1;” />

We have attached the modified HTML document with this post for your kind reference. input.zip (400 Bytes)