Commit 4f20bab5 authored by hj's avatar hj

更新提交

parent 9cd7ed60
...@@ -39,6 +39,9 @@ class ChemicalsMsdsService ...@@ -39,6 +39,9 @@ class ChemicalsMsdsService
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">', $msds_html); <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">', $msds_html);
preg_match('/<body>[\s]*?<style>(?<bodyStyle>[\s\S]*?)<\/style>/i',$msds_html, $bodyStyle); preg_match('/<body>[\s]*?<style>(?<bodyStyle>[\s\S]*?)<\/style>/i',$msds_html, $bodyStyle);
$msds_html = preg_replace('/<dd>[\s]*?<p>/i', '<dd>', $msds_html);
$msds_html = preg_replace('/<\/p>[\s]*?<\/dd>/i', '</dd>', $msds_html);
$msds_html = preg_replace('/<body>[\s]*?<style>(?<bodyStyle>[\s\S]*?)<\/style>/i', '@body@', $msds_html); $msds_html = preg_replace('/<body>[\s]*?<style>(?<bodyStyle>[\s\S]*?)<\/style>/i', '@body@', $msds_html);
$bodyStyle['bodyStyle'] = "<style>body{ font-family: 'msyh'; font-size: 0.8rem; font-weight: bold; display: block;}.container { padding-right: 5px;padding-left: 5px;margin-right: auto;margin-left: auto;width: 90%;} " . $bodyStyle['bodyStyle'] = "<style>body{ font-family: 'msyh'; font-size: 0.8rem; font-weight: bold; display: block;}.container { padding-right: 5px;padding-left: 5px;margin-right: auto;margin-left: auto;width: 90%;} " .
...@@ -52,7 +55,7 @@ class ChemicalsMsdsService ...@@ -52,7 +55,7 @@ class ChemicalsMsdsService
//$msds_html = preg_replace('/11123/', $bodyStyle['bodyStyle'], $msds_html); //$msds_html = preg_replace('/11123/', $bodyStyle['bodyStyle'], $msds_html);
$msds_html = preg_replace('/<\/body>/', '</div></body>', preg_replace('/@body@/', $bodyStyle['bodyStyle'], $msds_html)); $msds_html = preg_replace('/<\/body>/', '</div></body>', preg_replace('/@body@/', $bodyStyle['bodyStyle'], $msds_html));
//file_put_contents('./test.html', $msds_html); file_put_contents('./test.html', $msds_html);
$this->getPdfApp()->loadHTML($msds_html, 'utf-8'); $this->getPdfApp()->loadHTML($msds_html, 'utf-8');
//echo $htmlTemp; //echo $htmlTemp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment