G
G
Galdar Turin2019-03-05 15:59:20
phpspreadsheet
Galdar Turin, 2019-03-05 15:59:20

How to set PDF encoding to UTF-8 in PhpSpreadsheet's library?

How to save file in UTF-8 encoding?

require 'vendor/autoload.php'
use PhpOffice\PhpSpreadsheet\Writer\Pdf\Tcpdf;

$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();

$writerPDF = new Tcpdf($spreadsheet);

$writerPDF->writeAllSheets();
$writerPDF->setPreCalculateFormulas(false);
$writerPDF->save($file.'.pdf');

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question