From 6818e61478812434668efd4f6809e5f79ccbe655 Mon Sep 17 00:00:00 2001 From: wlx Date: Fri, 4 Nov 2011 09:58:43 +0000 Subject: [PATCH] =?UTF-8?q?ODT=E6=A0=BC=E5=BC=8F=E4=B8=AD=E6=9A=82?= =?UTF-8?q?=E6=97=B6=E4=B8=8D=E6=94=AF=E6=8C=81=E8=A1=A8=E6=A0=BC=EF=BC=8C?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E6=98=BE=E7=A4=BA=E7=9B=B8=E5=85=B3=E6=96=87?= =?UTF-8?q?=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/controllers/ServiceController.php | 38 ++++++++++++++++++- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/application/default/controllers/ServiceController.php b/application/default/controllers/ServiceController.php index c1c19b9e..de0324b5 100644 --- a/application/default/controllers/ServiceController.php +++ b/application/default/controllers/ServiceController.php @@ -415,7 +415,14 @@ class ServiceController extends Zend_Controller_Action $row['rfdenom']=@$dom->getElementsByTagName('rfDenom')->item(0)->nodeValue; $row['resolution']=@$xpath->query('//scaleDist/value/Real')->item(0)->nodeValue; $row['resolution'].=@$dom->getElementsByTagName('uomName')->item(0)->nodeValue; - + //提前对表格进行预处理 + /*$wiki=new WikiFormat(); + $row['description']=$wiki->parseTable($row["description"]); + preg_match_all('/[\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->metadata=$row; $pdf->Draw(); @@ -508,7 +515,34 @@ class ServiceController extends Zend_Controller_Action $row['rfdenom']=@$dom->getElementsByTagName('rfDenom')->item(0)->nodeValue; $row['resolution']=@$xpath->query('//scaleDist/value/Real')->item(0)->nodeValue; $row['resolution'].=@$dom->getElementsByTagName('uomName')->item(0)->nodeValue; - + //提前对表格进行预处理 + $wiki=new WikiFormat(); + $row['description']=$wiki->parseTable($row["description"]); + preg_match_all('/
[\s\S]*?<\/table>/im', $row['description'],$tables); + $search=array(); + $replace=array(); + foreach($tables as $k=>$table) + { + /*$search[]="
"; + $replace[]=''.str_repeat('',substr_count($table[0],'"; + $replace[]=""; + $search[]=""; + $replace[]=""; + $search[]=""; + $replace[]=""; + $search[]="
')); + $search[]="
"; + $replace[]=""; + $search[]=""; + $replace[]=""; + $search[]=""; + $replace[]=""; + $search[]="
"; + $replace[]=""; + $table=str_replace($search,$replace,$table[0]);*/ + $row['description']=str_replace($tables[$k][0],"\n 【表格内容暂不支持,请访问网站查看,此处请忽略】\n",$row['description']); + } + require_once('odtphp/library/odf.php'); $config["PATH_TO_TMP"]="/tmp/zip"; $config["ZIP_PROXY"]="ZipArchive";