Crop an Svg
I have a svg file, and i wanted to crop a small portion of svg by
drawing a rectangle (or else specifying some x,y,width,height values)
into a different window.
Thus, when you draw a small rectangle on the svg file, it should crop
the rectangled portion of the svg and create a new svg file just the
original svg. And this resultant svg file should be obiviously
smaller than the original svg file.
I adopted the following procedure..
1. I took the svg file and implemented the cliiping functinality as
we have a clip attribute in svg.
2. When i have drawn a rectangle on the svg, it takes the coordinates
of the drawn rectangle and passes to a servlet.
3.The servlet initially creates a file svg in the specified path and
addons the elements to the files according to our conditions applied.
4.The servlet takes checks coordinates with the each object elements
(like path d="M ....; text x=....) and writes into the created svg
5.Thus the required portion will be kept and the remaining (unwanted
elements which doesn't appear in the rectangle portion) are discared.
6.I could get the resultant svg file smaller compared to original one.
But, i need to get still smaller by discarding the coodinates
(unwanted) within the path element too.
Could anyone help in my Cropping svg???
I can give u the servlet, js and svg files too if needed.
Any method for this to solve are also heartily welcomed.
Thanks in advance