私はここ数日これを理解しようとしていますが、何も思いつきません。
私は自分のサーバーでdompdfを動作させており、pdfを正常に作成しています。唯一の問題は、送信した画像をレンダリングしないことです。DOMPDF_ENABLE_REMOTEをTRUEに設定し、tmpフォルダーは書き込み可能で、get_file_contentsがオンになっています。
これで、dompdfフォルダーにあるサンプルは、リモートイメージを正常にレンダリングします。これは、問題の原因となっているサーバーからのイメージファイルのようです。
絶対URLと相対URLを試しました。
私はこれをcodeigniterとそのベータバージョン0.6.0で実行しています。
これは私のヘルパーです:
function create_pdf($html, $filename, $stream=TRUE)
{
require_once("dompdf/dompdf_config.inc.php");
spl_autoload_register('DOMPDF_autoload');
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
if ($stream) {
$dompdf->stream($filename.".pdf");
} else {
write_file("./pdf_written_files/$filename.pdf", $dompdf->output());
}
}
私のコントローラー機能:
function pdf($id)
{
if($id !== NULL)
{
$this->load->helper(array('create_pdf','text'));
$result = $this->product_model->order_by('order')->get_by(array('id' => $id))? : NULL;
$collection = $this->collection_model->my_collection($result->id);
$range = $this->range_model->my_range($result->id);
$result->collection = $collection;
$result->range = $range;
$this->_data['content'] = $result;
$html = $this->load->view('created_pdf', $this->_data, TRUE);
create_pdf($html, $result->title);
}
else
{
echo 'no input found';
}
}