DEV Community

Dimitrios Desyllas
Dimitrios Desyllas

Posted on

Greek letters are replaced with ??? once I convert a docx into pdf using PHPWord?

I made the following simple laravel artisan command:

Artisan::command('test:pdf',function(){
    \PhpOffice\PhpWord\Settings::setPdfRendererName(\PhpOffice\PhpWord\Settings::PDF_RENDERER_DOMPDF);
    \PhpOffice\PhpWord\Settings::setPdfRendererPath('.');

    $tmpFile = storage_path().'/contracts/test.docx';
    $outfile = storage_path().'/contracts/test.pdf';

    $phpWord = \PhpOffice\PhpWord\IOFactory::load($tmpFile);
    $phpWord->save($outfile,'PDF');

});

It receives a docx file and converts it into pdf. But for an ackward reason the docx contains greek letters and once rendered in pdf are converted into…

Top comments (0)