【发布时间】:2014-12-03 08:52:07
【问题描述】:
我想问怎么把excel转成pdf?
我想放5个excel文件,点击上传后转换成1个pdf?
现在我在这段代码中使用:
/**
* Example: DOMPDF
*
* Documentation:
* http://code.google.com/p/dompdf/wiki/Usage
*
*/
public function index() {
// Load all views as normal
$this->load->view('test');
// Get output html
$html = $this->output->get_output();
// Load library
$this->load->library('dompdf_gen');
// Convert to PDF
$this->dompdf->load_html($html);
$this->dompdf->render();
$this->dompdf->stream("welcome.pdf");
}
图书馆:
类 Dompdf_gen {
public function __construct() {
require_once APPPATH.'third_party/dompdf/dompdf_config.inc.php';
$pdf = new DOMPDF();
$CI =& get_instance();
$CI->dompdf = $pdf;
}
}
【问题讨论】:
-
可能重复,这个答案可能对你有帮助stackoverflow.com/questions/23223491/…
-
我看到了帖子但我不明白我的代码我上传文件 excel 并且在我打开文件并从 excel 中获取数据并放入 pdf 之后这可能吗?
标签: php excel codeigniter pdf