TE Edit Control Java / HTML-JavaScript Help
Product page

HTML Add-on Interface

*************************************************************************************************

HTML Add-on is NOT available for TE Edit Control for Java yet. The methods described in this topic are for future use only (not available at present).

************************************************************************************************

You do not necessarily need to create a Htn object to do standard import and export of HTML data within TE Edit Control. Simply copy htn.dll to the application directory containing tej.dll.

Now use the TerSetHtnLicenseKey method to set the license key for HTML Add-on. The license key for HTML Add-on is e-mailed to you after your order for HTML Add-on is processed. Please note that your license key for TE Edit Control is not valid for HTML Add-on.

tej1.TerSetHtnLicenseKey("xxxxx-yyyyy-zzzzz")

Export TE document as HTML:

First set the output format to SAVE_HTML using the TerSetOutputFormat method:

   tej1.TerSetOutputFormat(tej.SAVE_HTML)

Now you can use any of the TE's output methods or properties to extract the data in the HTML format:

   String HtmlText=tej1.Data 

Import an HTML document into TE:

First set the input format as html:

   tej1.TerSetFlags4(True,tej.TFLAG4_HTML_INPUT)

Now you can use any of the TE's input methods or properties to insert html data into TE:

   tej1.Data = HtmlText

In the above examples, TE automatically creates an HTML object for you to do input or output of html data. However, you can also create the HTML object explicitly. The later method is suitable if you need to call the html methods (such as HtsSetFlags) prior to doing export or import of html data.

Explicitly creating Htn object for doing HTML import/export:

First create an Htn object and pass it to TE:

  using SubSystems.TE; // namespace containing TE methods - C# syntax
  using SubSystems.HT; // namespace containing Htn methods
  Imports SubSystems.TE   ' VBN syntax
  Imports SubSystems.HT   ' VBN syntax
  HTN htn1=new Htn(tej1)  // pass the Tej class object to bind to the 
                            new Htn object

// set the license key. Your license key for HTML Add-on is e-mailed to you after your order for HTML Add-on is processed.

  Htn.HtsSetLicenseKey(xxxx-yyyy-zzzz) 

// Now pass the Htn object to TE.

  tej1.TerSetHtnObject(htn1)

Now TE can use this Htn object to do import or export of HTML data as described earlier in this topic.