What I'm trying to accomplish is to render formatted text at a specific location on the document and have it wrap in a predefined rectangle, but the text might not have the same style for the entire block. I have to parse a small subset of html and render that. The problem is that with MigraDoc I couldn't find any way to position the paragraph or set a bounding rectangle for it. Using just PdfSharp I would have to render the text character by character because I haven't found a way to render text when the formatting changes. Here's a sample html block that shows what I'm trying to render:
Code:
<P ALIGN="CENTER">
<FONT FACE="_Times" SIZE="32" COLOR="#FFFFFF" LETTERSPACING="0" KERNING="0">
This is one long sentence that will wrap to <U>multiple lines</U> and center any text.
</FONT>
</P>
<P ALIGN="LEFT">
<TEXTFORMAT LEADING="18">
<FONT FACE="_Times" SIZE="32" COLOR="#FFFFFF" LETTERSPACING="0" KERNING="0">
This<FONT COLOR="#FF0000"> text </FONT>should be left aligned.
</FONT>
</TEXTFORMAT>
</P>
<P ALIGN="JUSTIFY">
<FONT FACE="_Times" SIZE="32" COLOR="#FFFFFF" LETTERSPACING="2.2" KERNING="0">
<FONT COLOR="#0000FF">But</FONT> this should be <FONT COLOR="#00FF00">justified</FONT>. So should this.
</FONT>
</P>
For that example I have a document that I need to render that text to. I know what x and y position I need to put the text at and I know the size of the bounding box the text needs to wrap in. I'm just not sure which approach is the best at this point.
Thanks in advance for any help Thomas.