mpdf ไม่ออก ภาษาไทยครับ

wave
สมเกียรติ โกญจนาท
3,927
สังคมนักพัฒนาระบบ (Community)
mpdf ไม่ออก ภาษาไทยครับ

 

จาก บทความ "https://www.programmerthailand.com/tutorial/post/view/82/extension-การสร้างรายงานในรูปแบบไฟล์-pdf-ด้วย--mpdf"

ผมเพิ่ม file pdf.css แล้ว 

web/css/pdf.css

code

 $content = "สวัสดี";
 $pdf = new Pdf([
            'mode' => Pdf::MODE_UTF8,
            // A4 paper format
            'format' => Pdf::FORMAT_A4,
            // portrait orientation
            'orientation' => Pdf::ORIENT_PORTRAIT,
            // stream to browser inline
            'destination' => Pdf::DEST_BROWSER,
            // your html content input
            'content' => $content,
            // format content from your own css file if needed or use the
            // enhanced bootstrap css built by Krajee for mPDF formatting
            'cssFile' => '@web/css/pdf.css',
            // any css to be embedded if required
            'cssInline' => '.bd{border:1.5px solid; text-align: center;} .ar{text-align:right} .imgbd{border:1px solid}',
            // set mPDF properties on the fly
            'options' => ['title' => 'Preview Report Case: test '],
            // call mPDF methods on the fly
            'methods' => [
                //'SetHeader'=>[''],
                //'SetFooter'=>['{PAGENO}'],
            ]
        ]);
     
    // return the pdf output as per the destination setting
    return $pdf->render(); 
 

ไม่ออก ภาษาไทยเลยครับ ต้องแก้ที่ไหนบ้าง

 

 

2 ความคิดเห็น

  • มานพ กองอุ่น

ได้แก้ไข CSS หรือยังครับ

body{ font-family: "Garuda"; font-size: 10pt; }

 

ไม่ทราบว่าตอนนี้แก้ไขได้หรือยังครับ หรือมีความเคลื่อนไหวอย่างไรบ้างครับ