Skip to main content
Inspiring
July 28, 2010
Question

Oddity with exporting html from textflow

  • July 28, 2010
  • 1 reply
  • 724 views

Hi,

I am using the following code to export html from my editable textFlow:

            public function getXmlFromFlow(flow:TextFlow, title:String):XML{
                var temp:XML = XML(TextConverter.export(flow, TextConverter.TEXT_FIELD_HTML_FORMAT, ConversionType.STRING_TYPE).toString());
                var holder:XML = new XML("<" + title + " />");
                for each(var p:XML in temp..BODY.P){
                    holder.appendChild(p);
                }
                return holder;
            }

This function takes a textflow and title and returns an xml tag named according to my title and with the html as its child.

This functions, however, I am getting font tags within font tags, like this:

<titleHtml>
<P ALIGN="left">
<FONT FACE="Arial" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="1">
<FONT SIZE="64">JOE SCHMO</FONT>
</FONT>
</P>
</titleHtml>

And when I bring this html back into the textflow with this code :

textFlow = TextConverter.importToFlow(MYXML, TextConverter.TEXT_FIELD_HTML_FORMAT);

I get the proper text, but the size (should be 64) does not render, it shows up at the 12 size of the parent.

Am I doing something wrong?

This topic has been closed for replies.

1 reply

box86rowhAuthor
Inspiring
July 28, 2010

After testing the exported html in the browser, it seems to produce the results I wanted, however when

I import this html into my textflow it does not porcess the nested font tag styles..


Adobe Employee
July 30, 2010

I'm a bit puzzled.  I tried importing this markup into TLF as HTML in 1.0/1.1 and 2.0 and the text always showed up at 64 pt.

<titleHtml>
<P ALIGN="left">
<FONT FACE="Arial" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="1">
<FONT SIZE="64">JOE SCHMO</FONT>
</FONT>
</P>
</titleHtml>

Richard