• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

embedding images in HTML

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
I don't always make ads but when I do they're tiny
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic