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条)

报告相同问题?