PHP :从 html 创建 400-500 页的 PDF
PHP : Create PDF from html with 400-500 pages
我将 html 转换为包含 400-500 页的 PDF 文件,使用 wkhtmltopdf. But getting undesirable spaces after each 4 rows in table. How to overcome this issue ? HTML is looks fine but PDF 有空格。
我使用以下内容创建 PDF。
- PHP =>
exec('/usr/bin/wkhtmltopdf temp.html temp.pdf 2>&1', $output);
- HTML 中的样式:
@media all { table { empty-cells: hide !important;} tr {
page-break:avoid; page-break-inside: avoid; empty-cells:hide;
margin:0px; padding:0px;} .pgBrk { page-break-after: always
!important; page-break-inside:avoid !important;} tr.json-array-table
{ page-break-inside: avoid !important;}
求推荐。
我使用 TCPDF library. wkhtmltopdf is fast execution but less customization. TCPDF supports customization and a lot of key features when you work with the creation of PDF files. We can checkout BEST library in php here 完成了此操作。
我将 html 转换为包含 400-500 页的 PDF 文件,使用 wkhtmltopdf. But getting undesirable spaces after each 4 rows in table. How to overcome this issue ? HTML is looks fine but PDF 有空格。
我使用以下内容创建 PDF。
- PHP => exec('/usr/bin/wkhtmltopdf temp.html temp.pdf 2>&1', $output);
- HTML 中的样式:
@media all { table { empty-cells: hide !important;} tr { page-break:avoid; page-break-inside: avoid; empty-cells:hide; margin:0px; padding:0px;} .pgBrk { page-break-after: always !important; page-break-inside:avoid !important;} tr.json-array-table { page-break-inside: avoid !important;}
求推荐。
我使用 TCPDF library. wkhtmltopdf is fast execution but less customization. TCPDF supports customization and a lot of key features when you work with the creation of PDF files. We can checkout BEST library in php here 完成了此操作。