laravel - How to set custom header in elibyy/tcpdf-laravel
问题描述
I'm using this: https://github.com/elibyy/tcpdf-laravel. I need to setup multiline header strings and horizondal ruler. I have attached the images for reference.
PDF::setHeaderCallback(function ($pdf) use ($pdfname) {
// Set font
$pdf->SetFont('cid0jp', '', 10);
// Title
$pdf->Cell(0, 15, '', 0, false, 'C', 0, '', 0, false, 'M', 'M');
$pdf->Cell(0, 15, $pdfname, 0, false, 'C', 0, '', 0, false, 'M', 'M');
});
How can i do that?
解决方案
I moved to use phantomjs and it is working perfecrtly. The Idea I used there is to generate a html file and store it in a temporary place and passing that location to Phantomjs. It generated as a PDF what is inside the html file.
This post helped me to achieve this https://medium.com/@ayusharma.in/generate-pdf-file-using-phantomjs-885a374cda61
推荐阅读
- c# - Global.asax 和 MasterPage 之间会发生什么?
- php - 当我选择等级时,如何从表 gaji 中获取 gaji
- perl - Outlook 不呈现已发送的电子邮件
- php - Laravel sanctum csrf cookie 每个请求?
- python-3.x - 尝试使用 python 打印一些表是 sqlite3
- java - Spring Boot:控制器不考虑验证器
- .htaccess - 重定向到 url 但保留根路径
- python - 为什么 python 子进程中的“dd”不向 STDOUT 写入任何字节?
- apache-spark - 有没有办法在 Hadoop 2.8+ 中使用 PySpark?
- python - AttributeError:模块'tensorflow._api.v1.compat.v1.compat'没有属性'v1