doujing5937 2016-03-09 17:54
浏览 57
已采纳

TCPDF UTF-8日文文件名未显示

I try to make a report with tcpdf but it's not working with utf-8 (Japanese) . (PHP language).

PDF::SetTitle('Cat Report');
    PDF::SetSubject('Dog Report');
    // PDF::SetFont('kozgopromedium', '', 12);
    PDF::SetFont('dejavusans', '', 12);
    PDF::AddPage();
    PDF::writeHTML($html_header_style . $html, true, false, true, false, '');
    $pdfFileName = "園児コード";

    PDF::Output($pdfFileName . '.pdf','D');

But output file name is: .pdf. I cannot open this file. Japanese file name is not showing up

Any help would be appreciated.

  • 写回答

2条回答 默认 最新

  • douchen7324 2016-10-24 04:50
    关注

    I resolved this.

    In 'tcpdf.php' file: i was comment from line 7559 to 7562

    public function Output($name='doc.pdf', $dest='I') {
        ...
        //if ($dest[0] != 'F') {
            //$name = preg_replace('/[\s]+/', '_', $name);
            //$name = preg_replace('/[^a-zA-Z0-9_\.-]/', '', $name);
        //}
        ...
    }
    

    Reference library doc: tcpdf

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥30 关于#java#的问题,请各位专家解答!
  • ¥30 vue+element根据数据循环生成多个table,如何实现最后一列 平均分 合并
  • ¥20 pcf8563时钟芯片不启振
  • ¥20 pip2.40更新pip2.43时报错
  • ¥15 换yum源但仍然用不了httpd
  • ¥50 C# 使用DEVMOD设置打印机首选项
  • ¥15 麒麟V10 arm安装gdal
  • ¥20 OPENVPN连接问题
  • ¥15 flask实现搜索框访问数据库
  • ¥15 mrk3399刷完安卓11后投屏调试只能显示一个设备