wkhtmltopdf Windows下 测试demo 成功
2017-03-14 15:54
441 查看
html2pdf 转pdf 中文不换行 然后找到了wkhtmltopdf 支持中文换行 样式也支持
在PHP中生成PDF文件,可以使用 FPDF 和 TCPDF 。但是它们只能用于创建简单的表格,当涉及到需要将图像添加到表中,就无法产生所需的布局。有一个强大的工具叫wkhtmltopdf就能够实现。
Wkhtmltopdf 是一个shell工具,它使用了WebKit渲染引擎和QT,将HTML转换为PDF格式。
wkhtmltopdf 下载地址 http://www.softpedia.com/get/Office-tools/PDF/wkhtmltopdf.shtml
在PHP中生成PDF文件,可以使用 FPDF 和 TCPDF 。但是它们只能用于创建简单的表格,当涉及到需要将图像添加到表中,就无法产生所需的布局。有一个强大的工具叫wkhtmltopdf就能够实现。
Wkhtmltopdf 是一个shell工具,它使用了WebKit渲染引擎和QT,将HTML转换为PDF格式。
wkhtmltopdf 下载地址 http://www.softpedia.com/get/Office-tools/PDF/wkhtmltopdf.shtml
$pdf_tool=dirname(__FILE__).'\bin\wkhtmltopdf'; //exec("D:/xampp/htdocs/test/wkhtmltopdf/bin/wkhtmltopdf bin/ceshi2.html bin/ceshi2.pdf"); exec("$pdf_tool bin/ceshi2.html bin/ceshi2.pdf"); if(file_exists("bin/ceshi2.pdf")){ header("Content-type:application/pdf"); //直接下载 //header("Content-Disposition:attachment;filename='ceshi2.pdf'"); // echo file_get_contents("/tmp/{$filename}.pdf"); header('Pragma: public'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Content-Transfer-Encoding: binary'); header('Content-Length: '.filesize('bin/ceshi2.pdf')); //pdf预览模式 header('Content-Disposition: inline; filename="ceshi2.pdf";'); echo file_get_contents('bin/ceshi2.pdf'); //readfile("bin/ceshi2.pdf"); }else{ exit; }
相关文章推荐
- Token Kidnapping Windows 2003 PoC exploit (Win2K3测试成功)
- Windows 7 下 ORACLE10G安装方法(自己测试成功)
- wkhtmltopdf 中文不能显示问题完美解决
- MySQL主从复制与读写分离在windows系统下的实现(amoeba3.0+mysql5.1实现)因版本问题,本文在原来文章基础上有更改并且本人已经测试成功
- windows 7 安装 sam-ba at91 usb to serial converter 驱动不成功的解决
- Demo: Fill and Save PDF Form online(also can add more function,such as email and save data to database ),Adobe Reader is enough
- wkhtmltopdf:一个 Linux 中将网页转成 PDF 的智能工具
- html to pdf - 使用Wkhtmltopdf.exe - 实现,可导出需登录的页面
- 命令行下的html转pdf工具wkhtmltopdf
- JAVA如何把word,excel,ppt转成PDF,已经过测试成功。
- Windows 7 下 ORACLE10G安装方法(自己测试成功)
- wkhtmltopdf.exe >>html to PDF
- html转pdf(rails、jruby、ruby) wkhtmltopdf
- windows下测试oracle安装是否成功
- 用命令测试maven是否安装成功和创建maven java项目和maven javaweb 项目demo
- HTML转换成PDF工具:wkhtmltopdf
- windows 7 安装 sam-ba at91 usb to serial converter 驱动不成功的解决
- Dev-C++使用wkhtmltopdf的API的配置
- Ubuntu Server中安装wkhtmltopdf Odoo最新版打印需要这个