Skip to main content
Inspiring
June 4, 2009
Question

Embed images in text flow. Any progress?

  • June 4, 2009
  • 3 replies
  • 7432 views

Hi

I read a post here that the possibility of adding an embedded image to a <flow: img> tag was listed for future implementation.

It would be great not to have to load the graphic as an URL when creating a dynamic textFlow.

Is this still a coming feature?

regards

Micheal

This topic has been closed for replies.

3 replies

Participating Frequently
September 29, 2009

I'm late to the discussion, newbie in textflow. If I'm not worried about actually embedding the image, can I reference an external image in the xml markup for the TextFlow?

Seeing your example, I tried <flow:img src=" etc. but I'm getting errors. Looking everywhere for sample markup...

Can you or anyone help? Thanks!

mxcAuthor
Inspiring
September 29, 2009

Hi,

The xml I use for an image is as follows

<?xml version='1.0' encoding='utf-8'?>

    <flow:TextFlow xmlns:flow='http://ns.adobe.com/textLayout/2008'><flow:p><flow:img source='myImage' height='20' width='20' id='image'</flow:img></flow:p></flow:TextFlow>

Hope that helps

Micheal

Inspiring
October 13, 2009

mxc, so what exactly is 'myImage'?  Is it an URL or URI?  Or is it a reference to an embedded bitmap in your application?  If so, what is needed to accomplish this?

This does not seem to work for me, for what ever reason.  Please help.

Thanks.

Adobe Employee
June 8, 2009

I was wondering why you had to transfer the images with the message?  Aren't they already in the chat application?  In any case suppose you do - you could invent an XML format that contains all the images plus the TextFlow.

<xml>

  <img1>... image date .. </img1>

  <img2> .. image date ... </img2>

   <TextFlow> ... content .. </TextFlow

</xml>

Transmit that, parse and create the images, parse the TextFlow and then connect the images using Robin's tagging scheme.

Hope that helps,

RIchard

mxcAuthor
Inspiring
June 8, 2009

Thanks for your suggestions. I am not sure how I would implement Robins idea or what the advantage would be over my current solution?

And Richard I am not sending graphics simply replacing text with graphics.

For example a chat user writes a message including a :-) or ;-) or one of several other possibilities, this chat message is then sent as a string to the server where it is sent back to the chat application. All very straightforward and common procedure in chat apps.

The new inlineGraphics make it possible to include graphic emoticons in the text. So what I do is search the message string for text smileys and replace the text :- ) with a graphic smiley .

At the moment I find the smileys and put in a graphic using with the <flow. img> tag, then build the TextFlow which works fine but we would like to use embedded graphics at some point in the future hence my question.

It would be great to have a bit more detail on your suggested solution because I am not sure what Robin means by ' search the TextFlow after its been imported and attach them directly by assigning to the InlineGraohicElements graphic property'.

Thanks again for your replies

Micheal

Adobe Employee
June 5, 2009

We still have it on our list of features to consider, but have not done any work on it. I can certainly see that it would be useful, and I would guess we would at least try to do something that would make this easier.

Where would you put the image? Would you want to encode it in the XML? An XML file is just text, so there's nowhere to embed the image.

Thanks!

- robin

mxcAuthor
Inspiring
June 6, 2009

Thanks for your answer

Well at the moment I am working on a chat program and I search the typed in string for smileys and replace them with the correct emoticon.

I do this by inserting <flow: img> tag in the correct places. So I would like to embed the emoticon graphics. As you point out it would not be possible in the xml. Have you another approach which might work?

regards

Micheal

Adobe Employee
June 8, 2009

If you have some very specific icons you're using, you could search the TextFlow after its been imported and attach them directly by assigning to the InlineGraohicElements graphic property. You could either look for a particular source value on the InlineGraphicElement, or attach your own styleName property to handle this. The original markup would result in a TextFlow that has either the source or the styleName you check for, and then you just have to write up a fix-up function that iterates through the TextFlow visiting all the FlowElements on the tree and setting the graphic properties of the InlineGraphicElements.