【问题标题】:Bootstrap panel heading background color half coloring domPDFBootstrap 面板标题背景颜色半着色 domPDF
【发布时间】:2016-02-29 23:02:18
【问题描述】:

如标题所说,以下是遇到的问题。

在浏览器上查看:

使用domPDF转成pdf后,背景颜色看起来好难看:

工作环境

  • DomPDF:0.7.x@beta
  • 引导框架:引导 v3.3.5

相关代码:

// instantiated Dompdf obj
$dompdf = new Dompdf();
// model method for data populating
$data = $this->populateStatus( 31 );
// call the view together with data
$page = $this->load->view('model/controller', $data, true );
$dompdf->loadHtml( $page );
// (Optional) Setup the paper size and orientation
$dompdf->setPaper('A4', 'landscape');
// Render the HTML as PDF
$dompdf->render();
// Output the generated PDF to Browser
$dompdf->stream();

我使用外部 css 包含样式表,该背景的 html 只是一个简单的面板:

<div class="panel panel-default">
    <div class="panel-heading page">
       Text Here
    </div>
</div>

有什么解决方法吗?如果你们中的任何人想要更多输入或任何相关的代码示例,请告诉我。谢谢。

【问题讨论】:

    标签: php twitter-bootstrap-3 dompdf


    【解决方案1】:

    如果左下角没有应用半径,则在使用边框半径时 dompdf(最高 0.7.0)存在错误。在这种情况下,dompdf 无法正确完成掩码定义,导致备用侧捷径返回原点。

    要解决此问题,您可以将 1px 的小边框半径应用于左下角。

    对于 Bootstrap 面板,您只需将以下 CSS 添加到样式表中:

    .panel-heading { border-bottom-left-radius: 1px; }
    

    【讨论】:

    • 问题已修复。谢谢。
    猜你喜欢
    • 2017-11-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-23
    • 2013-04-01
    • 2015-09-21
    • 2014-12-17
    • 1970-01-01
    相关资源
    最近更新 更多