www.gnostice.com 

HTMLTextOut Method

Top  Previous  Next

 

The HTMLTextOut method exports rich text from a file to the current document.

 

Syntax

 

 

[VC++]

void HTMLTextOut(double X, double Y, LPCTSTR HTMLString);

 

[C#]

public abstract new void HTMLTextOut (System.Double X , System.Double Y, System.String HTMLString)

 

[VB]

Sub HTMLTextOut(X As Double, Y As Double, HTMLString As String)

 

 

Parameters

 

X, Y

The location where the text has to be displayed

 

HTMLString

The text in HTML format with HTML tags.

 

Remarks

 

Use HTMLTextOut to render text with special formatting applied to the text being rendered. The string passed to HTMLTextOut can containing simple inline HTML tags to specify the special formatting to be applied on the text placed between the opening and closing tags. The following are the four types of formatting supported.

 

Bold

<b>....</b>

Italic

<i>....</i>

Underlined

<u>....</u>

StrikeOut

<s>....</s>

 

 

X: Specifies the X co-ordinate of the starting position.

Y: Specifies the Y co-ordinate of the starting position.

HTMLText: The text with the HTML tags that needs to be formatted.

 

 

The text is specified in the similar manner as text in HTML format. For example to display text in bold you will need to pass it in the following manner:

 

<b>Gnostice</b>

This will display:-

Gnostice .

 

This holds good for all format tags specified above i.e.

For ITALICS you need to write the text in the '<i>....</i>' tags.
For UNDERLINE you need to write the text in the '<u>....</u>' tags.
For STRIKEOUT you need to write the text in the '<s>....</s>' tags.

 

The tags may used in combination also. If you want to display text as Bold and Italic at the same time you may write it as:

<b><i>Gnostice</i></b>

This will display:-

Gnostice.

 

The order of the HTML tags does not matter. You may close it in any order irrespective of the order in which they were opened.

Thus <b><i>Gnostice</b></i> will also yield:-

Gnostice

 

Note:

If you want to display '<', '>' or '/' as a part of the text you will need to use it in combination with the escape character i.e. slash(/).

 

Any other text other than HTML tags that have to be displayed between the angular brackets can be displayed easily as follows:

To display <Gnostice I.T.> as bold you will need to pass it as <b><Gnostice I.T.></b>.

So this will display:-

<Gnostice I.T.>

 

If any of the above mentioned special formatting letters used in tags need to be displayed within angular brackets they must be passed as follows:

/</i> will display:-

<i>

/<///i> will display:-

</i>

 

 

Example

 

HTMLTextOut