-1

I need to Read an SVG and Render that on Canvas. But the problem is, I need to skip certain elements which contains the text I don't want. I know that specific text ( its not dynamic).

I am thinking of getting All the xml schema into java code and then delete those nodes and then push to client and paste on canvas via jQuery.

What method would be the best? And how?

  • My point is, If its possible that I can read the DOM elements of SVG into an object, skip those who I dont require and parse that object to canvas in web page. – user2505019 Apr 16 '15 at 06:25

1 Answers1

1

You could use jQuery (or just plain JS) to select the elements you don't want. Then set display to "none"

$("text:contains('here')").css("display", "none");
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<svg>
  <text y="50">Hello</text>
  <text y="100">There</text>
</svg>
Paul LeBeau
  • 97,474
  • 9
  • 154
  • 181