Using WebEngine + WebView rich HTML control?

Someone has already tried using WebEngine/WebView to create (static) content, which can combine text with images?

What I would like is a control capable of reflow where I can put in text style (different styles, sizes, fonts) and some pictures go hand in hand and that the text nicely reflow around the images. Since HTML has been able to do this for centuries, and since I donot think that even a new RichText control will be able to mix images and text (and certainly not to offer all other features in HTML, such as tables, etc...), I think the Web view could fill this gap.

Get the page HTML itself inside the control is easy, using the loadContent methods... but what about pictures? I would need some kind of hook to provide Images directly (from a database or memory, no intermediate download URL step) for the WebEngine, but it seems not to be.

I guess I could put up a local Web server and point my "img src" tags to get what I want, but there may be an easier way?

Let me know.

I've been kicking around the idea of pair components WebView/WebEngine with an http server embedded in my application. I saw something as the pier. It is probably overkill for your application.

Since you mention only static images residing in a database, I think that you can embed the image directly in the HTML code as an object of data with the appropriate mime type.

This link has a discussion about it:

http://rifers.org/blogs/gbevin/2005/4/11/embedding_images_inside_html

and so for this:

http://www.campaignmonitor.com/blog/post/1761/embedding-images-in-email/

If you need an example of this, just check your email SPAM. These guys are experts.

I think it goes something like this:

-Pat

Tags: Java

Similar Questions

Maybe you are looking for