-2

i want the data to be in svg format but it is posting the data in image format how do i change the data into svg format on back end the data look like this

array(3) {
  ["version"] => string(1) "2"
  ["data"] => string(24510) "data:image/png;.;base64,iVBORw0KGgoAAAANSUhEUgA...
  ["filename"] => string(31) "fileName"
}

and my extjs code is

var chartData = Ext.ComponentQuery.query('#mychart')[0];
        chartData.download({
                            type: 'image/svg',
                            filename: "FileName",
                            url: 'uploads/news/newstarts'
                        })
Waqar Haider
  • 929
  • 10
  • 33

1 Answers1

0

I was unable to convert the image/png type to svg, so i use the png image. First i get the data that i had

than i save the data as image and use it in the pdf by fdpi library with tcpdf $date = strtotime($date->format('Y-m-d H:i:s'));

$url = ROOT.'/uploads/print-stats-irstpr'.$date.'.png';
    $data = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $_REQUEST['data']));
    file_put_contents($url, $data);
Waqar Haider
  • 929
  • 10
  • 33