Bootstrap在pdf内部不起作用 [英] Bootstrap not working inside pdf
本文介绍了Bootstrap在pdf内部不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的控制器代码
public function actionPrint_death_certificate1()
{
$this->layout = 'certificate';
$html = $this->render('test');
require_once(Yii::$app->basePath . "/../vendor/mpdf/mpdf/mpdf.php");
$mpdf=new mPDF();
$mpdf->WriteHTML($html);
$mpdf->Output();
}
我的观点
<div class="container">
<div class="row">
<div class="col-md-6">
Heading1
</div>
<div class="col-md-6">
Heading2
</div>
</div>
</div>
现在我得到了标题为1和标题2为两行的pdf文件.引导程序不起作用.我想念什么吗?
Now i get a pdf with heading1 and heading2 in two different lines. Bootstrap is not working. Am i missing something?
return $this->render('test');
当我尝试这个时,它正在工作,并且heading1和heading2正好排成一行.在pdf中不起作用
When i tried this one it is working and heading1 and heading2 is coming in one line. In pdf it is not working
推荐答案
我在github上发布了一个问题,mpdf的人告诉我,mpdf内的 bootstrap不支持现成的,并且您有使用一些自定义样式. Github链接
I posted an issue in github and mpdf guys told that bootstrap not supported out-of-the-box inside mpdf and you have to use some custom style. Github link
这篇关于Bootstrap在pdf内部不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文