【发布时间】:2014-09-27 17:29:22
【问题描述】:
我正在使用 wkhtmltopdf 进行 html 到 pdf 的转换。
但是我发现使用像素定义的宽和长不起作用。
我已将页面大小设置为 Letter Landscape 表示 769 x 612 像素
但是当我使用 pdf 时,不会覆盖整个页面空间。
在某个论坛中,我了解到 wkhtmltopdf 将“mm”作为默认单位。
我也尝试搜索wkhtmltopdf保存的默认dpi,但没有得到任何参考。
当我使用这个推荐生成pdf时..它不起作用...PDF中没有内容
$output = exec('./wkhtmltopdf-linux-amd64 --disable-smart-shrinking --dpi 72 -L 0mm -T 0mm -s Letter -O Landscape '.$url.' ./getpdf.pdf 2>&1');
谁能帮帮我?
【问题讨论】:
-
我也在为同样的问题苦苦挣扎……
-
我已经试过了。完全错误的答案。这根本不起作用。
标签: php wkhtmltopdf