i have several charts in my extjs4application dashboard.. i want to generate a pdf report using the images of those charts for that i use iTextSharp
is there a way to get the images from the charts in order to include them in my report?
the ideal for me is to use it like this with itextsharp
MyImageStream = new MemoryStream();
myChart.SaveImage(MyImageStream);
my chart would be the chart object
i asked around in the forums they told me i would generate and render my chart at client (already done) and then i would get the svg, send it to the server and server would use it to generate the pdf... but i dont know how to work with svg neither how to send it to server
EDIT
im trying to use wkhtmltoimage to save my chart into image
but its not working whan i specify a mapPath to my .aspx
but it works fine if i specify a website url or localhost path (see htem in comment)
by doesnt work i mean no error but no png created!
my code:
var url = HttpContext.Current.Server.MapPath("~/chartImage.aspx");//dosnt work
//works : // "google.com"; //"localhost/chartImage.aspx";//
var fileName = " pie13.png ";
var wkhtmlDir = HttpContext.Current.Server.MapPath("~/wkhtmltopdf/pdf/");//"C:\\Program Files\\wkhtmltopdf\\";
var wkhtml = HttpContext.Current.Server.MapPath("~/wkhtmltopdf/wkhtmltoimage.exe");//"C:\\Program Files\\wkhtmltopdf\\wkhtmltopdf.exe";
var p = new Process();
p.StartInfo.CreateNoWindow = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.UseShellExecute = false;
p.StartInfo.FileName = wkhtml;
p.StartInfo.WorkingDirectory = wkhtmlDir;
string switches = "";
//switches += "--print-media-type ";
//switches += "--margin-top 10mm --margin-bottom 10mm --margin-right 10mm --margin-left 10mm ";
//switches += "--page-size Letter ";
p.StartInfo.Arguments = switches + " " + url + " " + fileName;
p.Start();
thanks in advance