gpt4 book ai didi

php - wkhtmltopdf:如何使用它?

转载 作者:搜寻专家 更新时间:2023-10-31 20:49:36 28 4
gpt4 key购买 nike

我希望能够生成并保存 PHP 页面的 PDF 版本。我在 Stackoverflow 上发现,最推荐的是 wkhtmltopdf: http://code.google.com/p/wkhtmltopdf/

但是,我没有任何 Shell 或二进制知识;我只会 HTML 和 PHP。

谁能清楚地指导我如何使用 wkhtmltopdf(仅使用 FTP 和 PHP)让 php 页面生成 PDF 文档?

最佳答案

您是否阅读了项目主页的 wiki 部分?它有 IntegrationWithPhp页。希望能帮到你。

阅读评论以了解如何使用在 wiki 中找到的类:

$html = file_get_contents("http://www.google.com");
//echo $html;
$pdf = new WKPDF();
$pdf->set_html($html);
$pdf->render();
$pdf->output(WKPDF::$PDF_EMBEDDED,'sample.pdf');

关于php - wkhtmltopdf:如何使用它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9614577/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com