ODT格式中暂时不支持表格,直接显示相关文字

This commit is contained in:
wlx 2011-11-04 09:58:43 +00:00
parent c7d5138e5c
commit 6818e61478
1 changed files with 36 additions and 2 deletions

View File

@ -415,7 +415,14 @@ class ServiceController extends Zend_Controller_Action
$row['rfdenom']=@$dom->getElementsByTagName('rfDenom')->item(0)->nodeValue; $row['rfdenom']=@$dom->getElementsByTagName('rfDenom')->item(0)->nodeValue;
$row['resolution']=@$xpath->query('//scaleDist/value/Real')->item(0)->nodeValue; $row['resolution']=@$xpath->query('//scaleDist/value/Real')->item(0)->nodeValue;
$row['resolution'].=@$dom->getElementsByTagName('uomName')->item(0)->nodeValue; $row['resolution'].=@$dom->getElementsByTagName('uomName')->item(0)->nodeValue;
//提前对表格进行预处理
/*$wiki=new WikiFormat();
$row['description']=$wiki->parseTable($row["description"]);
preg_match_all('/<table>[\s\S]*?<\/table>/im', $row['description'],$tables);
foreach($tables as $k=>$table)
{
$row['description']=str_replace($tables[$k],"\n 【表格内容暂不支持,请访问网站查看,此处请忽略】\n",$row['description']);
}*/
$pdf=new MetadataPDF(); $pdf=new MetadataPDF();
$pdf->metadata=$row; $pdf->metadata=$row;
$pdf->Draw(); $pdf->Draw();
@ -508,6 +515,33 @@ class ServiceController extends Zend_Controller_Action
$row['rfdenom']=@$dom->getElementsByTagName('rfDenom')->item(0)->nodeValue; $row['rfdenom']=@$dom->getElementsByTagName('rfDenom')->item(0)->nodeValue;
$row['resolution']=@$xpath->query('//scaleDist/value/Real')->item(0)->nodeValue; $row['resolution']=@$xpath->query('//scaleDist/value/Real')->item(0)->nodeValue;
$row['resolution'].=@$dom->getElementsByTagName('uomName')->item(0)->nodeValue; $row['resolution'].=@$dom->getElementsByTagName('uomName')->item(0)->nodeValue;
//提前对表格进行预处理
$wiki=new WikiFormat();
$row['description']=$wiki->parseTable($row["description"]);
preg_match_all('/<table>[\s\S]*?<\/table>/im', $row['description'],$tables);
$search=array();
$replace=array();
foreach($tables as $k=>$table)
{
/*$search[]="<table>";
$replace[]='<table:table table:name="Table 3">'.str_repeat('<table:table-column />',substr_count($table[0],'<th>'));
$search[]="<tr>";
$replace[]="<table:table-row>";
$search[]="<td>";
$replace[]="<table:table-cell><text:p>";
$search[]="<th>";
$replace[]="<table:table-cell><text:p>";
$search[]="</td>";
$replace[]="</text:p></table:table-cell>";
$search[]="</th>";
$replace[]="</text:p></table:table-cell>";
$search[]="</tr>";
$replace[]="</table:table-row>";
$search[]="</table>";
$replace[]="</table:table>";
$table=str_replace($search,$replace,$table[0]);*/
$row['description']=str_replace($tables[$k][0],"\n 【表格内容暂不支持,请访问网站查看,此处请忽略】\n",$row['description']);
}
require_once('odtphp/library/odf.php'); require_once('odtphp/library/odf.php');
$config["PATH_TO_TMP"]="/tmp/zip"; $config["PATH_TO_TMP"]="/tmp/zip";