我正在尝试使用wkhtmltopdf将我的数据下载到pdf以获取以下错误。
任何帮助都会非常感激。
An uncaught Exception was encountered
Type: Exception
Message: System error
Loading pages (1/6)
[> ] 0%
[======> ] 10%
[=======> ] 12%
Warning: SSL error ignored
[========> ] 14%
[=========> ] 16%
[==========> ] 18%
[============> ] 20%
[=============> ] 23%
[===============> ] 25%
[================> ] 27%
[=================> ] 29%
[==================> ] 31%
[===================> ] 33%
[=====================> ] 35%
[======================> ] 38%
[========================> ] 40%
[=========================> ] 43%
[===========================> ] 45%
[============================> ] 47%
[=============================> ] 49%
[=====================================> ] 63%
[==========================================> ] 70%
[=============================================> ] 76%
[=================================================> ] 83%
[============================================================] 100%
Counting pages (2/6)
[============================================================] Object 1 of 1
Resolving links (4/6)
[============================================================] Object 1 of 1
Loading headers and footers (5/6)
Printing pages (6/6)
[> ] Preparing
[==============================> ] Page 1 of 2
[============================================================] Page 2 of 2
Done
Filename: application/libraries/Wkhtmltopdf.php
Line Number: 866
Backtrace:
File: /var/www/admin/index.php
Line: 315
Function: require_once
这是我的PHP codeigniter文件中的行,如果有帮助则发送错误:
$html = $this->load->view('report/view_course_summary_pdf', $data, true);
$pdfFilePath = "Course_Summary_Report.pdf";
$options['path'] = $myPath;
$options['orientation'] = 'Landscape';
$options['commandOptions'] =
array(
'useExec' => true, // Can help if generation fails without a useful error message
'procEnv' => array(
// Check the output of 'locale' on your system to find supported languages
'LANG' => "'" . $this->session->userdata('lang_code') . "_US.utf-8" . "'",
)
);
$this->load->library('wkhtmltopdf', $options);
$this->wkhtmltopdf->setTitle($this->common_lang->get_lang_token('course_summary_report'));
$this->wkhtmltopdf->setOptions(['ignoreWarnings' => true]);
$this->wkhtmltopdf->setHtml($html); // $html can be a url or html content.
$this->wkhtmltopdf->output(Wkhtmltopdf::MODE_DOWNLOAD, $pdfFilePath);
许多人谈到了与使用WKPDF和SSL相关的类似问题,但我不认为这会导致我的问题,因为它说SSL错误被忽略了......任何帮助都会非常感激。每当我尝试这样做时,我的HTML都会被下载,但是使用上面的Codeginter代码就会损坏格式。