class_mcCairoSvg.inc.php
545 Bytes
<?php
class mcCairoSvg {
/**
*
* @param string $param_svgFileString
*/
public static function svgToPdf($param_in_svg, $param_out_pdf=false) {
if($param_out_pdf === false) {
$param_out_pdf = tempnam("/tmp", "mcInkscape_");
$tmp_png = $param_out_pdf.'.pdf';
mcFile::rename($param_out_pdf, $tmp_png);
$param_out_pdf = $tmp_png;
}
$inkscape_order = "cairosvg.sh $param_in_svg $param_out_pdf";
$shell_exec = shell_exec($inkscape_order);
D::show($shell_exec, $inkscape_order);
return $param_out_pdf;
}
}
?>