1

html ページから .pdf を作成するために、クラス htmltodoc を使用しようとしています: 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 (内部サーバー エラー)

誰か助けてくれませんか?

4

1 に答える 1

1

HTML を PDF に変換する場合は、次のような PDF ライブラリを使用できます。

于 2012-04-24T15:50:54.590 に答える