dongmei8071 2012-09-26 14:25
浏览 162
已采纳

转换为pdf时出现html2pdf错误

I have the following code:

<?php session_start();
ob_start(); 
// on vérifie toujours qu'il s'agit d'un membre qui est connecté
if (!isset($_SESSION['login'])) { 
   // si ce n'est pas le cas, on le redirige vers l'accueil
   header ('Location: ../index.php'); 
   exit();  
}  
require_once('Connections/localhost.php'); 
mysql_select_db( $database_localhost ); ?>
 <page backtop="50mm"  backbottom="30mm" > 
    <page_header> <font face="arial">
<?php $sql="SELECT `entete`, `pieddepage` FROM `entete` INNER JOIN `courrier` ON `entete`.`id` = `courrier`.`code_entete` WHERE `courrier`.`code_lettre`='".mysql_real_escape_string($_POST['courrier'])."'" ;
 $msg= $_POST['msg'];
$result= mysql_query($sql);
$donnees=mysql_fetch_assoc($result) ;
echo $donnees['entete'] ;  ?>       </font>       
    </page_header> 
    <page_footer> <font face="arial">
<?php echo $donnees['pieddepage'] ;  ?>     
</font>   
    </page_footer> 
    <font face="arial">
    <?php echo '<font face="Arial">'.$_POST['editor1'].'</font>' ; ?></font>
 </page> 
<?php $content=ob_get_contents();
    ob_end_clean();
   require_once('html2pdf.class.php');
   $html2pdf = new HTML2PDF('P','A4','fr');
   $html2pdf->WriteHTML($content);
$path= 'courriers';
if(file_exists($path)) 
{ 
mkdir($path.'/'.$_GET['n_doss']); 
}
else
{
mkdir($path);
mkdir($path.'/'.$_GET['n_doss']); 
}
  $html2pdf->Output($path.'/'.$_GET['n_doss'].'/'.$_POST['nom_courrier'].'-'.date('d-m-Y').'.pdf', 'F');
  $url=$path.'/'.$_GET['n_doss'].'/'.$_POST['nom_courrier'].'-'.date('d-m-Y').'.pdf';
$sql="INSERT INTO `courrier-envoye` SET
qui = '".$_SESSION['login']."',
quoi = '".$_POST['nom_courrier']."',
quand = '".date('Y-m-d')."',
n_doss= '".$_GET['n_doss']."',
url= '".$url."'";
$req=mysql_query($sql) or die(__LINE__.mysql_error().$sql); 


 header('Location: '.$url);

?>

In fact it says to me:

TCPDF ERROR: Could not include font definition file: verdana

But the thing is that I never put somewhere in my code something like <font face='verdana'>

So I really do not know where does this trouble come from.

Receive all my Utmost Respect.

Kind Regards.

SP

  • 写回答

2条回答 默认 最新

  • dpwdsmbvm496180204 2012-09-26 14:35
    关注

    Look at this one. may be it helps.

    Make font for HTML2PDF

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?