Bosnian characters in FPDF

165
July 23, 2018, at 8:40 PM

I have an bosnian string $string = "Saglasno odredbama čl.19 Zakona o udruženjima i Statuta Udruženja računovođa i knjigovođa Srbije URIKS iz Beograda, ul."

I used "Write" function of fpdf http://www.fpdf.org/ but all "č" characters become to "è"

$pdf->Write (6, iconv('UTF-8', 'CP1250//TRANSLIT', "Saglasno odredbama čl.19 Zakona o udruženjima i Statuta Udruženja računovođa i knjigovođa Srbije URIKS iz Beograda, ul."));

How can I fix it? thank so much!

Answer 1

Something like this should work:

require_once 'fpdf181\fpdf.php';
require_once 'fpdf181\makefont\makefont.php';
MakeFont('C:\\Windows\\Fonts\\arial.ttf','cp1252');
$pdf = new FPDF();
$pdf->AddFont('Arial','','Arial.php');
$pdf->AddPage();
$pdf->SetFont('Arial','',16);
$pdf->Write(6,'Saglasno odredbama čl.19 Zakona o udruženjima i Statuta Udruženja računovođa i knjigovođa Srbije URIKS iz Beograda, ul.');
$pdf->Output();

Try to change the encoding to cp1250 or ISO-8859-2.

Source: http://www.fpdf.org/en/tutorial/tuto7.htm

If all this should fail then try to use UTF-8: http://www.fpdf.org/en/script/script92.php

Rent Charter Buses Company
READ ALSO
How to check specyfic url_path in preg_match

How to check specyfic url_path in preg_match

How can I check if specific path match to pattern

163
composer unable to install laravel/passport

composer unable to install laravel/passport

I have created a new project with

229
Import Video from URL and directly pass to visitor for download

Import Video from URL and directly pass to visitor for download

I am facing the issue that we are linking amp4-File on a shared hosting system, but we'd like to have the link working as a download link

179