2

Am stuck with a problem in tcpdf.Now am creating a pdf document using tcpdf.Here i have a field which is dynamical generated from pgsql database.It contain both arabic and english.But english words are reverted when they mix with arabic.Please help me with any tutorials or sample code links.

Freddy Pv
  • 96
  • 12

2 Answers2

1

Please implement following solutions here:-

1) put a copy of ARIALUNI.ttf in fonts folder under tcpdf installation (i've taken my copy from windows\fonts folder).

2) make a temporary script in examples folder of tcpdf and execute it with this line:

$fontname = $pdf->addTTFfont('../fonts/ARIALUNI.ttf', 'TrueTypeUnicode', '', 32);

3) set the new font in your pdf generator script:

$pdf->SetFont('arialuni', '', 20);

Please refer also link How to generate multilingual content Pdf in PHP

Community
  • 1
  • 1
Roopendra
  • 7,490
  • 16
  • 62
  • 87
0

For some time this font has not existed on a new Windows/Office. Details see: https://docs.microsoft.com/en-us/typography/font-list/arial-unicode-ms So you have to get it from another place ...

The new version of TCPDF has its own object to create font files, as they are used afterwards by TCPDF: TCPDF_FONTS

For more details and an example see: https://stackoverflow.com/a/70337995/2320007

Sarah Trees
  • 754
  • 10
  • 25