【问题标题】:Dompdf output contains weird bordersDompdf 输出包含奇怪的边框
【发布时间】:2015-09-27 16:28:27
【问题描述】:

我目前正在尝试使用 DOMPDF 将 HTML 文件转换为 PDF 文件。然而,转换后的 pdf 文件包含这些红色和黄色边框。有什么办法可以去掉这些边框?

我的 html 的一部分:

<!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');
    }
}

【问题讨论】:

    标签: codeigniter dompdf


    【解决方案1】:

    您似乎已在 dompdf.config.php 中将 DOMPDF_DEBUG_LAYOUT 常量设置为 true

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-08-03
      • 2012-07-23
      • 2016-11-07
      • 2014-03-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多