views:

91

answers:

1
+1  Q: 

Adobe TLF and HTML

Hi,

What is the best way to convert a tlf markup to HTML? I want only standar HTML without the old font tag. I think I saw a utility created by someone for this, but I can remember where it is. any ideas?

Tks.

A: 

http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3_Flex/WSc3ff6d0ea7785946579a18b01205e1c5646-7fef.html

var ptext:String = "Hello, World"; 
var flow:TextFlow = TextConverter.importToFlow(ptext, TextConverter.PLAIN_TEXT_FORMAT); 
var out:XML = TextConverter.export(flow, TextConverter.TEXT_LAYOUT_FORMAT, ConversionType.XML_TYPE );

but use TextConverter.TEXT_FIELD_HTML_FORMAT instead of TextConverter.PLAIN_TEXT_FORMAT

Eugene
thanks for the response. The problem with this method is that it returns very very very old HTML, with the "font" tag. I want standard HTMl with paraghas and styles.
fast-dev
yeap, @vov11 it's bad but I think with core functions we will not get better export. You could write additional e4x parser to replace old font tags to CSS style as you want. let me know.
Eugene