Skip to main content
Participant
Jun 29, 2011 7:47 PM UTC
Question

TextConverter TLF string markup is incorrect

I am having trouble getting a textflow markup string out of a textarea component.  Using a simple spark textarea and the following code I get the following markup string.

typ is the spark text area that houses the flow that I need converted and tlfText is a box to view the markup.

tlfTest.text = TextConverter.export(typ.textFlow, TextConverter.TEXT_LAYOUT_FORMAT, ConversionType.STRING_TYPE).toString();

This code seems to work in the example below:

http://blog.flexexamples.com/2009/07/25/exporting-a-textflow-object-in-flex-4/

I have essentially copied the conversion part of the example and am getting markup that looks like this:

<TextFlow whiteSpaceCollapse="preserve" version="2.0.0" xmlns="http://ns.adobe.com/textLayout/2008"><p><span></span></p></TextFlow>

This is for a blank window, but even when there is text with formatting it doesn't markup all the formatting.  The paragraph and span elements always seem to be fine.  However the higher level attributes are missing.  Such as columnCount.  Also the white space is always preserved and causing ugly looking documents on reload.  I have tried to set the whitespace to collapse- but have continually failed.

My end goal is to get a markup string that I am saving to a database and can later reload- work on and then put back.  The editing tools that I am using for the textarea are essentially the same as those in the example.

I am probably missing somthing simple- hopefully someone can point out my error easily.  Thanks,

-Jonathan Rios

This topic is closed to new replies. Start a new post to keep the conversation going.

5 replies

xSeleucusAuthor
Participant
Jun 30, 2011 12:04 PM UTC

More information- it seems that the whitespacecollapse is defaulting to preserve, but everything I have read says that it defaults to colllapse.  Possibly implying that somewhere along the line it is being set to preserve.  I have tried manually setting the whitespace collapse but it hasn't worked.  Any thoughts would be great.

-Jonathan Rios

Translate
xSeleucusAuthor
Participant
Jun 30, 2011 6:15 PM UTC

Ok more information.  When I view just the whitespacecollapse propery of the textflow, it says collapse.  Yet somewhere in the conversion string it is being changed to preserve.  I am not certain why, I will keep looking...

-Jonathan Rios

Translate
Adobe Employee
Jul 1, 2011 3:20 AM UTC

For whitespacecollapse, it's by design.  The markup written by TLF's exporter round trips correctly when whiteSpaceCollapse is preserve.  Change it and you get a different result.

Translate