Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
Embedded image in UltraFormattedTextEditor
posted

Hi there!

Is there a way to embed an image into the FormattedTextEditInfo of an UltraFormattedTextEditor in a way, that the outcoming Data is valid html?

Because if I choose 'Embed image data in xml' it gives me an image tag, with a data attribute where the image is embedded in binary format, but which my browser won't display.

Is it possible to tweak Settings of the UltraFormattedTextEditor to make the outcoming xml valid to display properly in browsers? Or are there any other ways?

Can someone here give me a hint?

Parents
  • 4940
    Offline posted

    GuidoKoehler said:

    Hi there!

    Is there a way to embed an image into the FormattedTextEditInfo of an UltraFormattedTextEditor in a way, that the outcoming Data is valid html?

    Because if I choose 'Embed image data in xml' it gives me an image tag, with a data attribute where the image is embedded in binary format, but which my browser won't display.

    Is it possible to tweak Settings of the UltraFormattedTextEditor to make the outcoming xml valid to display properly in browsers? Or are there any other ways?

    Can someone here give me a hint?

    Can you give a little more information about how you're using the UltraFormattedTextEditor?

    One way out of many to achieve what you're asking would be to copy the Value of the editor to a string variable, and then:

     

    Search for: data="

    Replace with: src="data:image/jpg;base64,

    Then your image tag should be valid html. Although, you may encounter problems displaying the image if it's in a file format other than JPG, since it is what we specified the data to be.

     

    Note: Replacing what I mentioned above will cause the display of the image in the UltraFormattedTextEditor to become invalid, so you'd have to search and replace in the opposite direction if you wanted to the put the value back into the editor.

Reply Children