PDA

View Full Version : Can ExtJs convert SVG to Image



nandanjain
20 May 2013, 10:47 PM
Hi,
I am new to ExtJS. I want to know if there is a way to convert SVG data into Image (png, jpg etc) file or not? I know I can do same by using Batik library but that would require me to send data to server.

Thanks

tvanzoelen
21 May 2013, 12:58 AM
This is done serverside. Extjs has some functions to send a svg string to the server and catch the output.

http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.draw.engine.ImageExporter

nandanjain
21 May 2013, 1:19 AM
I looked at the documentation Ext.draw.engine.ImageExporter but still not sure who does the conversion? Sencha API does the conversion or I have to get it through Batik library? If Sencha API does on the server side then what is the name of component?

tvanzoelen
21 May 2013, 1:36 AM
The server does the processing


To do this, the svg string must be sent to a remote server and processed.

It seems a Sencha server does the processing


Important: By default, chart data is sent to a server operated by Sencha to do data processing. You may change this default by setting the defaultUrl of this class. In addition, please note that this service only creates PNG images.

It is send to

http://svg.sencha.io

but you can change that to your own server

nandanjain
24 May 2013, 4:52 AM
Hi, Thanks for your reply.

I want to host component on my company server which converts SVG to an Image. I haven't found anything on how conversion component works, what library and what API it uses. My application can not make to call to http://svg.sencha.io (http://svg.sencha.io/) and receive a response.