Skip to main content
Participant
June 29, 2011
Question

TextConverter TLF string markup is incorrect

  • June 29, 2011
  • 1 reply
  • 967 views

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 has been closed for replies.

1 reply

xSeleucusAuthor
Participant
June 30, 2011

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

xSeleucusAuthor
Participant
June 30, 2011

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

Adobe Employee
July 11, 2011

I am not quite sure what you mean.  Although I was able to create a workaround that accomplishes what I need.  One day I will figure out the correct way.  Thanks,

-Jonathan Rios


A single TextFlow may flow through multiple containers, where each container has a different columnCount. If it is applied in the containers, the containers will always win. Flow UI always applies it to the containers, so in that case you never see it in the markup.