我正在尝试使用 htmltodoc 类从 html 页面创建 .pdf: http ://www.phpkode.com/source/s/html-to-doc-classes/html-to-doc-classes /html_to_doc.inc.php
并使用库 LiveDocx(使用 Zend): http ://srhwd.com/documentation/moodle/_mail_merge_8php_source.html
无需创建 .doc 。这是我的代码:
$htmltodoc= new HTML_TO_DOC();
$htmltodoc->createDocFromURL("http://www.youtube.com/","google.doc",false);
$mailMerge = new Zend_Service_LiveDocx_MailMerge(
array (
'username' => 'xxxxxxx',
'password' => 'xxxxxxx'
)
);
$mailMerge->setLocalTemplate($htmltodoc);
//$mailMerge->setLocalTemplate('template.doc'); Normally, template.doc is registered on server
$mailMerge->createDocument();
$document = $mailMerge->retrieveDocument('pdf');
header('Content-disposition: attachment; filename=document.pdf');
header('Content-type: application/pdf');
echo $document;
但它返回:
错误 HTTP 500(内部服务器错误)
有人能帮助我吗 ?