如何在PHP中将HTML转换为pdf [英] How to convert HTML to pdf in PHP

查看:91
本文介绍了如何在PHP中将HTML转换为pdf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将带有css的html页面转换为php中的pdf格式。



我尝试了什么:



尝试使用wkhtmltopdf,很难实现

I need to convert html page with css to pdf in php .

What I have tried:

tried with wkhtmltopdf ,its to hard to implement

推荐答案

选择符合您需求的HTML到PDF命令行转换器工具安装它。



阅读工具文档并使用命令行执行转换,直到获得所需的输出。然后将命令传递给PHP PHP:shell_exec - Manual [ ^ ]功能。



如果您在使用该工具时遇到问题,请尝试使用支持选项。对于 wkhtmltopdf ,这将是 Google网上论坛:wkhtmltopdf一般 [< a href =https://groups.google.com/forum/#!forum/wkhtmltopdf-general\"target =_ blanktitle =New Window> ^ ]邮件列表。
Choose an HTML to PDF command line converter tool that fits your needs and install it.

Read the documentation of the tool and perform conversions using the command line until you got the desired output. Then pass the command to the PHP PHP: shell_exec - Manual[^] function.

If you have problems using the tool, try the support options. For wkhtmltopdf this would be the Google Groups: wkhtmltopdf General[^] mailing list.


这篇关于如何在PHP中将HTML转换为pdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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