【问题标题】:float not working in dompdf laravel 4浮动在dompdf laravel 4中不起作用
【发布时间】:2014-10-15 03:45:50
【问题描述】:

我正在使用 dompdf 创建 pdf 文件,但 float 属性不起作用。我将 DOMPDF_ENABLE_CSS_FLOAT 更改为 true。它在普通 php 中运行良好,但在 laravel 4 中无法运行。

这是我的代码。

<!doctype html>
<html lang="en">
<head>
 <style type="text/css">
.left {
  float: left; 
  outline: 1px solid green; 
  width: 6cm; 
}
.right {
  float: left; 
  outline: 1px solid blue; 
  width: 6cm; 
}
 </style>
</head>
<body>

  <div class="left" style="float:left;">left boxes here</div>
  <div class="right" style="float:right;">right boxes here</div>

</body>
</html>

谢谢。

【问题讨论】:

  • CSS 的其余部分是否正确加载?您可以尝试在运行时检查浮动设置:$dompdf-&gt;get_option('enable_css_float');.

标签: php laravel-4 dompdf html-to-pdf


【解决方案1】:

dompdf_config.inc.php 文件中使用def("DOMPDF_ENABLE_CSS_FLOAT", true); 并在您的 pdf 设计中使用 css 浮点数,它可以工作

【讨论】:

  • 非常感谢..karthik pyrate
  • 在 Laravel dompdf_config.inc.php 找不到文件
  • 在 laraveldompdf -> config -> dompdf.php 中添加 enable_css_float => true
猜你喜欢
  • 2017-10-04
  • 2020-04-04
  • 2018-05-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-11-06
  • 1970-01-01
  • 2014-06-08
相关资源
最近更新 更多