2015-09-27 127 views
0

我目前正在尝试使用DOMPDF将HTML文件转换为PDF文件。但是,转换后的PDF文件包含这些红色和黄色边框。有什么办法可以删除这些边界吗?我的html的Dompdf输出包含奇怪的边界

enter image description here

部分:

<!DOCTYPE html> 
<html lang="en"> 
<head> 
    <meta charset="UTF-8"> 
    <!--<link rel="stylesheet" href="<?php echo base_url('styles/CPP.css')?>" type="text/css" />--> 
</head> 
<body> 
    <div id="header"> 
     <div id="logo"> 
      <!--<img src="<?php echo base_url('styles/logo.gif')?>"/>--> 
     </div> 
     <div id="version-date"> 
      <p>Version date: 26 Aug 2015</p> 
     </div> 
     <div id="form-title"> 
      <p><i>Research and Consultancy Office</i></p> 
      <p>Graduate Studies and Research Education</p> 
      <p style="font-size: 25px"><strong>Conference Participation Proposal</strong></p> 
     </div> 
    </div> 

    <div id="info"> 
     <p>This form will be used by Coordinating Supervisors to recommend their research students for 
      conference participation. File Naming Instruction for 2015. For an applicant associated with the 
      FECS Faculty, intending to participate in the conference CONF2015, please save the form with a 
      file name like this: <strong>2015</strong> FECS <strong>Student Name (</strong>CONF2015 <strong> 
       Participation Proposal).docx</strong></p> 
    </div> 


    <div id="form-content"> 
     <!--<table border="1">--> 
     <table border="1" cellpadding="0" cellspacing="0"> 
      <tr> 
       <th class="table-title" colspan="4">STUDENT DETAILS</th> 
      </tr> 
      <tr> 
       <td class="align-right">Student ID</td> 
       <td></td> 
       <td class="align-right-a">Student Name</td> 
       <td></td> 
      </tr> 
      <tr> 
       <td class="align-right">Course (MBus/MSc/PhD)</td> 
       <td></td> 
       <td class="align-right-a">Date of Enrolment</td> 
       <td></td> 
      </tr> 
      <tr> 
       <td class="align-right">Research Focus or Topic</td> 
       <td colspan="3"></td> 
      </tr> 
      <tr> 
       <td class="align-right">Coordinating Supervisor</td> 
       <td colspan="3"></td> 
      </tr> 
     </table> 

我的控制器:

class Welcome extends CI_Controller { 

    function __construct() 
    { 
     parent::__construct(); 
     $this->load->helper('url'); 
     require_once(APPPATH.'third_party/dompdf/dompdf_config.inc.php'); 
    } 
    public function index() 
    { 
     $dompdf = new DOMPDF(); 
     $data = "123"; 
     $html = $this->load->view('CPP_form/Conference_Participation_Proposal.html',$data,true); 
     $dompdf->load_html($html); 
     $dompdf->render(); 
     $dompdf->stream('CPP_Form.pdf',array('Attachment'=>0)); 
     //$this->load->view('CPP_form/Conference_Participation_Proposal.html'); 
    } 
} 

回答

1

你似乎已经把DOMPDF_DEBUG_LAYOUT常数为true dompdf.config.php