<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <form action="" method="post"> <div class="form-group"> <input type="text" name="name" class="form-control" placeholder="* Podaj swoje imię" required> </div> <div class="form-group"> <input type="submit" class="form-control guzik" name="go" value="Generuj plik PDF"> </div> </form> <?php $name = $_POST["name"]; $go = $_POST["go"]; if($go) : $text = iconv("utf-8","ISO-8859-2",$name); require('fpdf.php'); $pdf = new FPDF('P','mm','A4'); $pdf->AddFont('EBGaramond12-Regular','','EBGaramond12-Regular.php'); $pdf->AddPage(); $pdf->SetFont('EBGaramond12-Regular','',16); $pdf->Cell(0, $height,$text, 0, 0, 'C'); $pdf->Output(F,'logo/plik.pdf'); endif; ?> </body> </html>
Znalazłem rozwiązanie. Wystarczy zastosować modyfikacje biblioteki FPDF, która obsługuje UTF-8.
http://www.fpdf.org/en/script/script92.php