こんにちは私はcodeigniterファイル内の特定のディレクトリにdompdfを保存し、保存したファイルを電子メールとして送信しようとしています。私はこの作業をすべて行うためにcodeigniterを使用しています。 ここに関数があります。指定されたディレクトリにDOMPDFを保存してから電子メールで送信する
public function generateCreditAggreement(){
$this->load->helper('file');
require_once(APPPATH.'third_party/dompdf/dompdf_config.inc.php');
$pdfroot = dirname(dirname(__FILE__));
$pdfroot .= '/third_party/pdf/';
$dompdf = new Dompdf();
$msg = $this->load->view('credit_agreement_view', '', true);
$html = mb_convert_encoding($msg, 'HTML-ENTITIES', 'UTF-8');
$dompdf->load_html($html);
$paper_orientation = 'Potrait';
$dompdf->set_paper($paper_orientation);
// Render the HTML as PDF
$dompdf->render();
// Output the generated PDF to Download folder
// $dompdf->stream('document.pdf');
//save the pdf file on the server
$pdf_string = $dompdf->output();
file_put_contents($pdfroot, $pdf_string);
}
私は取得していますエラーが Message: file_put_contents(C:\Apache24\htdocs\faceloan\faceloan\application/third_party/pdf/): failed to open stream: No such file or directory
ということですが、ディレクトリが存在しない、とパス名は正しいです。
ありがとうございました! –