将HTML转换为pdf、doc和xls的库


Library which converts HTML to pdf,doc and xls

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

试试这个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

这里有一个名为Php-KoolGrid的库,但它似乎只是导出html表。它有一些方法可以导出,比如

• PHP::GridTableView::ExportToExcel()
• PHP::GridTableView::ExportToWord()
• PHP::GridTableView::ExportToCSV()
• PHP::GridTableView::ExportToPDF()
• PHP::ExportSettings::IgnorePaging
• PHP::ExportSettings::FileName