]*>\s*(.*?<\/defs>)\s*<\/svg>/',$html,$m); $defs = $m[1]; $html = preg_replace('/]*>\s*\s*<\/svg>/','',$html); $html = preg_replace('/(]*>)/',"\\1".$defs,$html); preg_match_all('/]*)style="(.*?)"/',$html,$m); for ($i=0;$iConvertSize($wr[1],0,$mpdf->FontSize) * $mpdf->dpi/25.4; preg_match('/height: (.*?);/',$style, $hr); $h = $mpdf->ConvertSize($hr[1],0,$mpdf->FontSize) * $mpdf->dpi/25.4; $replace = 'WriteHTML($stylesheet,1); $mpdf->WriteHTML($html); $mpdf->Output(); //===================================================== } else { //===================================================== // To output SVG files readable by mPDF as text output header('Content-type: text/plain'); preg_match_all('//',$html,$m); for ($i=0;$i/',">\n",$svg); // Just add some new lines echo $svg."\n\n"; } //===================================================== } exit;