• Post Reply Bookmark Topic Watch Topic
  • New Topic

embedding images in HTML  RSS feed

 
Sai Shrawan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i'm trying to embed an image in a html document which can be done by using base64 encoding in HTML but for that i need to provide the content of the image in hexadecimal
can anyone tell me how this can be acheived in java
there's a restriction that i shudn't use applets for this...
 
Stephen Huey
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe I'm ignorant about this, but I'm not sure why you'd want to base64-encode the image in HTML unless it were going to be in an email or if it were going to be a parameter for an applet...


If you search for base64 encode java on Google, you'll find lots of results, like this one:

http://iharder.sourceforge.net/base64/

I've actually used this code:
http://www.rgagnon.com/javadetails/java-0083.html
 
Sai Shrawan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx stephen for ur timely response,

i'll chk out those links n try to figure out how can i use them in my appl.

just want to make my requirement clear:
actually i'm working on a richtext editor wherein the user of the application prepares documents n can insert images too... so my pblm is to embed those images directly into the HTML document push it to database for future reference ( i dont want to save the image as a seperate file )
when i searched internet for this i came across something interesting in this below link
http://www.bennherrera.com/EmbeddedImage/
wherein u can observe the approach used by Benn... but i cudnt get his what he did exactly in his java program ... i mailed him but cudnt get any response.

if u can get anything frm the above approach it wud be nice of u .... coz i think its suit my purpose...
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37181
515
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"sai4grps",
We're pleased to have you here with us in the <forum> forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious. Your signature of "Sai Shrawan" would make a great display name.

Thanks,
Jeanne
Forum Bartender
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!