File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "SVG with HTML" Watch "SVG with HTML" New topic
Author

SVG with HTML

Russ Chalfant
Greenhorn

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.
Russ
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 (http://xml.apache.org/batik/index.html).
Good luck.


- Chris Stehno, SCPJ
Khun Yee Fung
Greenhorn

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 http://www.w3.org/graphics/SVG 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="http://www.amazon.com/exec/obidos/ASIN/0201711036/ref=ase_electricporkchop/107-0402457-1632559" TARGET=_blank rel="nofollow">XSLT: Working with XML and HTML</A>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SVG with HTML