Grabbing SVG of Telerik Components

2 posts, 0 answers
  1. Harvey
    Harvey avatar
    4 posts
    Member since:
    May 2014

    Posted 24 Jul 2014 Link to this post

    Currently, I have an aspx page in vb that launches a RadHTMLChart and I want to grab the SVG code of that chart. However, since the chart is rendered client-side, I have to launch this aspx page and then grab the SVG code from a second aspx page during postback. Currently, I am using Server.Execute (firstpage.aspx) to grab the SVG code but this does not work. I want to use the SVG to generate a PDF document but the Server.Execute command seems to run in the background and the code that comes after it do not wait for it to finish first, hence I am not grabbing the SVG content. Does anyone know of another way to grab this SVG content? 
  2. Marin Bratanov
    Marin Bratanov avatar
    5916 posts

    Posted 28 Jul 2014 Link to this post

    Hello Harvey,

    RadHtmlChart renders its SVG during the Sys.Application.Init client-side event of the page that hosts it. Thus, the Sys.Application.Load event is the earliest point at which you can obtain its SVG rendering, as shown here: This solution relies on the chart being opened in the user's browser so the SVG string can be POST-ed to the server. If you only need to do this on the server you can look into other tools that let you run browsers on the server and obtain their content, like PhantomJS, for example.


    Marin Bratanov

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top