Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
765
Displaying an HTML section header
posted

Hi

I want to display an html in the section Header. Until now I used AddRichContent and it seemed to work for basic html . However now my html used the table tags and AddRichContent but it doesnt come out good

 

 

 

IText

 

 headerText = header.AddText(0, PAGE_HEADER_TOP_MARGIN)

 

 

headerText.AddRichContent(m_documentTitle

this is the text

<html><body><table><tr><td width="20%"><font size="2" face="Arial"><b>Milestone: </b>ms1<td/>
<td width="60%"><font size="2" face="Arial"><b>Milestone Scope Item: </b>Severe Defects</td><td width="20%" align="right"><font size="2" face="Arial"><b>Last KPI Date: </b>17/12/09</td>
</tr>
</table>
</body>
</html>

Can you please help

  • 12333
    posted

    Hi,

    The Document Engine does not have any intrinsic support for full HTML rendering. In other words, we currently do not have any ability to take an HTML string and directly translate it into Document Engine objects (such as lists, trees, grids, tables, etc).

    The procedure that you will have to use is something similar to the following logic:

    • Parse your HTML input
    • Iterate through your HTML elements
    • Create a logical tree that represents your HTML and content
    • "Translate" each of your HTML elements and content into the Document Engine object that you feel best represents your HTML elements. For example, the Table can be represented by the Grid object. 
    • Create your Document layout so that it represents your original HTML elements and content.

    The ability of directly rendering HTML by the Document Engine itself is a feature requested by customers. I will happily forward this forum post to our product manager so that it is also included within the collection of feature requests.

    Thanks,

    Tom