-2

是否有将 html 内容转换为 pdf、word 文档和 excel 文件的 php 库。我已经尝试过使用 tcpdf 库、phpword、phpexcel 但使用不同的库

4

2 回答 2

0

试试这个 http://html2pdf.fr/en/default

$html = file_get_contents("valid.html");
require_once("html2pdf.class.php");
$html2pdf = new HTML2PDF("P", "A4", "en", array(10, 10, 10, 10));
$html2pdf->setEncoding("ISO-8859-1");
$html2pdf->WriteHTML($html);
$html2pdf->Output("pdf/PDF.pdf", "F"); //output to file
$html2pdf->Output(); //output to browser
于 2013-08-05T07:01:49.917 回答
0

这是一个名为Php KoolGrid的库,但它似乎只导出了 html 表。它有一些导出方法,例如,

• PHP::GridTableView::ExportToExcel()
• PHP::GridTableView::ExportToWord()
• PHP::GridTableView::ExportToCSV()
• PHP::GridTableView::ExportToPDF()
• PHP::ExportSettings::IgnorePaging
• PHP::ExportSettings::FileName
于 2013-08-05T07:04:27.610 回答