Commit 615052c4 authored by hj's avatar hj

更新提交

parent b586a730
......@@ -79,7 +79,7 @@ class ChemicalsMsdsService
}
$msds_html = str_replace($dl, $dlHtml, $msds_html);
}
if($key == 1 || $key == 2 || $key == 4 || $key == 11 || $key == 13){
if($key == 1 || $key == 2 || $key == 4 || $key == 11){
preg_match_all('/<dt>(?<cTitle>[\s\S]*?)<\/dt>[\s]*?<dd[\s\S]*?>(?<cContent>[\s\S]*?)<\/dd>/i', $dl, $ddContent);
if($ddContent){
$dlHtml = '';
......@@ -90,6 +90,22 @@ class ChemicalsMsdsService
}
$msds_html = str_replace($dl, $dlHtml, $msds_html);
}
if($key == 13){
preg_match_all('/<dt>(?<cTitle>[\s\S]*?)<\/dt>[\s]*?<dd[\s\S]*?>(?<cContent>[\s\S]*?)<\/dd>/i', $dl, $ddContent);
if($ddContent){
$dlHtml = '';
foreach($ddContent['cTitle'] as $k => $c){
if($k == (count($ddContent['cTitle']) - 1)){
$dlHtml .= '<div style="width:90%"><span style="margin: 0;"><b>'.$c.'</b></span>';
$dlHtml .= '<span style="font-weight: normal;"><p>'.$ddContent['cContent'][$k].'</p></span></div>';
}else{
$dlHtml .= '<div style="width:90%"><span style="margin: 0;"><b>'.$c.'</b></span>';
$dlHtml .= '<span style="font-weight: normal;">'.$ddContent['cContent'][$k].'</span></div>';
}
}
}
$msds_html = str_replace($dl, $dlHtml, $msds_html);
}
}
}
preg_match('/(?<title>第[\s]*?3[\s\S]+?)<table[\s]*?class=[\\\'|\"]table-text-center avoid-page-break-inside[\\\'|\"]>[\s\S]*?<\/table>/i', $content['content'], $tableContent);
......@@ -106,7 +122,7 @@ class ChemicalsMsdsService
//file_put_contents('./test.html', $msds_html);
file_put_contents('./test.html', $msds_html);
//$msds_html = file_get_contents('./test.html');
$this->getPdfApp()->loadHTML($msds_html, 'utf-8');
......
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