从 PHP 执行 wkhtmltopdf [英] Execute wkhtmltopdf from PHP

查看:44
本文介绍了从 PHP 执行 wkhtmltopdf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Linux 命令行中运行良好:

I have this working fine from Linux command line:

wkhtmltopdf entry.html output.pdf

wkhtmltopdf entry.html output.pdf

但以下内容不适用于 PHP 代码:

But the following doesn't work from PHP code:

exec('wkhtmltopdf entry.html output.pdf');

exec ('wkhtmltopdf entry.html output.pdf');

有趣的是,我在谷歌上搜索了很多未经检查的解决方案,但没有解释为什么这是一个问题.如果你有好的,谢谢.

Interesting, I've googled and a lot of non-checked solutions and with no explanation why this is a problem. Thanks if you have the good ones.

推荐答案

wkhtmltopdf 有 bindings,其中之一是用于 PHP.你可以试一试.

wkhtmltopdf has bindings, one of them is for PHP. You could give those a shot.

这篇关于从 PHP 执行 wkhtmltopdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆