【问题标题】:Set title of pdf using mpdf file codeigniter使用 mpdf 文件 codeigniter 设置 pdf 的标题
【发布时间】:2016-10-13 09:19:34
【问题描述】:
$this->load->library('m_pdf');

$pdf = $this->m_pdf->load();

$pdf->SetTitle('My Doc');

$pdf->WriteHTML($html);

$pdf->Output($pdfFilePath, "F");

使用了 mpdf 的 SetTitle() 函数,但默认使用文件名:“Untitled Document - _Test_Company_10120.pdf”

同样设置了<title></title>标签但是没有用。

【问题讨论】:

  • 你能告诉你$pdfFilePath的位置和名字吗?
  • M 将文件存入服务器
  • 可以下载pdf文件还是保存根目录?
  • 请显示您的$pdfFilePath 值。你可以使用$pdf->SetTitle('My Doc');。但是设置文档的标题。查看 PDF 文件时,标题显示在 Adob​​e Reader 屏幕的顶部,并包含在文档元数据中,在 Adob​​e Reader 中检查文档属性时可以看到。
  • @razibalmamun 是 m 保存在 pdf_files 文件夹上的服务器上。

标签: codeigniter mpdf


【解决方案1】:

你使用了$pdf->SetTitle('My Doc'); 设置文档的标题。查看 PDF 文件时,标题显示在 Adob​​e Reader 屏幕的顶部,并包含在文档元数据中,在 Adob​​e Reader 中检查文档属性时可以看到。

所以,试试这个:

$pdfFilePath = "directory/your_pdf_name.pdf";
$pdf->Output($pdfFilePath, "F");

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多