It's not a secret anymore!
The moose likes XML and Related Technologies and the fly likes SVG with HTML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "SVG with HTML" Watch "SVG with HTML" New topic


Russ Chalfant

Joined: Nov 17, 2000
Posts: 4
Is there anyway to directly embed Scalable Vector Graphics into HTML? I am beginning to believe you can't, as all that I have read talks about using it with FOs and PDFs. Is SVG not intended to be used with HTML?
As an alternative, I looked for a utility which might translate a SVG file into a jpg or gif format. I tried using the the svg2jpg utility provided in the Csiro SVGToolkit, but the output was blurred.
Any help would be appreciated.
Chris Stehno
Ranch Hand

Joined: Feb 26, 2001
Posts: 180
I have never heard of directly coding SVG in an HTML page but I know that you can create SVG with XML. A JSP page could read the xml and generate the image when loaded... or you could probably translate SVG to GIF or JPG. You should look into Batik from the Apache Group (
Good luck.

- Chris Stehno, SCPJ
Khun Yee Fung

Joined: Feb 23, 2001
Posts: 24
This is how I am using SVG for the web site that I am building for a company. It might work for you. First, get a graphics designer to design some graphics that you need for a web page or a web site you are working on. If you have some drawing abilities, you can do that yourself too. Then, convert it to SVG (many graphics editors can do that now). You can go to the site to find out which tools can output SVG. Then, use XSLT or Java to modify the properties of the SVG generated. Then, use a graphics tool that accepts SVG and generates JPG or GIF. In this way, if only some properties of the graphics need to be changed from time to time, you can change them on-the-fly.

Khun Yee Fung
Author of XSLT: Working with XML and HTML

Khun Yee Fung<BR>Author of <A HREF="" TARGET=_blank rel="nofollow">XSLT: Working with XML and HTML</A>
I agree. Here's the link:
subject: SVG with HTML
It's not a secret anymore!