wkhtmltopdf codeigniter [英] wkhtmltopdf codeigniter

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

问题描述

wkhtmltopdf听起来像一个很好的解决方案...问题是没有发生在exec



shell_exec(c:\wkhtmltopdf.exe, http://www.google.com google.pdf);



我做错了什么?

解决方案

你可以使用官方
$ b

http://code.google.com/p / wkhtmltopdf / wiki / IntegrationWithPhp



如果没有,也许偷看他们做的事情会帮助你实现。

  //包含WKPDF类。 
require_once('wkhtmltopdf / wkhtmltopdf.php');

//创建PDF对象。
$ pdf = new WKPDF();
//设置PDF的HTML
$ pdf-> set_html('Hello< b> Mars< .b> ;!');
//将HTML转换为PDF
$ pdf-> render();
//输出PDF。建议文件名到浏览器。
$ pdf->输出(WKPDF :: $ PDF_EMBEDDED,'sample.pdf');



编辑



新连结,来自Githubs - https://github.com/mikehaertl/phpwkhtmltopdf


wkhtmltopdf sounds like an excellent solution...the problem is nothing happens on the exec

shell_exec("c:\wkhtmltopdf.exe","http://www.google.com google.pdf");

Am i doing anything wrong?

解决方案

Can you use the "official" class?

http://code.google.com/p/wkhtmltopdf/wiki/IntegrationWithPhp

If not, perhaps peeking into how they did things will help you out with your implementation.

// Include WKPDF class.
require_once('wkhtmltopdf/wkhtmltopdf.php');

// Create PDF object.
$pdf = new WKPDF();
// Set PDF's HTML
$pdf->set_html('Hello <b>Mars<.b>!');
// Convert HTML to PDF
$pdf->render();
// Output PDF. The file name is suggested to the browser.
$pdf->output(WKPDF::$PDF_EMBEDDED, 'sample.pdf');

Edit:

New link, from the Githubs - https://github.com/mikehaertl/phpwkhtmltopdf

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

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