-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm not able to send SVGGraph by email. there are showing a error invalid Xml. How can we save SVGGraph to PDF? #76
Comments
I presume you have your own graph you want to send, not the example graph. I would try turning off the tooltips using If it does not help, I would convert the SVG to a PNG or GIF and send that instead. |
This doesn't look like a PHP error, where is it coming from? |
I'm working on Vtiger CRM. |
I use the ImageMagick This is the function I use from my testing class: private function get_image($content)
{
$desc = array(
0 => array('pipe', 'r'),
1 => array('pipe', 'w'),
2 => array('pipe', 'w')
);
$process = proc_open('/usr/local/bin/convert svg:- png:-', $desc, $pipes);
if(is_resource($process)) {
fwrite($pipes[0], $content);
fclose($pipes[0]);
$png = stream_get_contents($pipes[1]);
$this->error = stream_get_contents($pipes[2]);
fclose($pipes[1]);
fclose($pipes[2]);
proc_close($process);
return $png;
}
return NULL;
} |
maybe try base64 encoding the SVG? return '<img width="100%" src="data:image/svg+xml;base64,' . base64_encode( $svgContent ).'"/>'; This is how you have to embed SVGs for DOMPdf, and I tend to do it for all embedding SVGs in HTML (for printing to pdf) |
No description provided.
The text was updated successfully, but these errors were encountered: