tags:

views:

85

answers:

2

Hi..i want to convert SVG into Bitmap Images likes (Jpeg, PNG etc) through javascript...Please help me out..Shall be very Thankful...any help will be awesome

Reagrds: Zain

A: 

If you don't mean programmatically, this question should probably belong to superuser.com.

Either way, the Batik SVG Toolkit may be of help, especially the SVG Rasterizer.

William
I want to convert it through javascript
Zain
javascript? not happening. at least not in typical browsers. maybe nodejs if you are very lucky...
fish2000
Ok thanks :) :)
Zain
@fish2000: not true, please see my answer
echo-flow
@echo-flow wow i am pleased to stand corrected on that one, thanks
fish2000
+3  A: 

Here is how you can do it through JavaScript:

  1. Use the canvg JavaScript library to render the SVG image using Canvas: http://code.google.com/p/canvg/
  2. Capture a data URI encoded as a JPG from the Canvas, according to these instructions: http://stackoverflow.com/questions/923885/capture-html-canvas-as-gif-jpg-png-pdf/3514404#3514404
echo-flow