PDF Arabic Language Support

I have developed an extend that generates pdf. The supported pdf format is old Version: 6.0.038
Release date: 2013-10-06. I have upgraded that from the file vendor and faced some problems that the files are not generated without errors.

Comments

  • khalidaou said:

    I have developed an extend that generates pdf. The supported pdf format is old Version: 6.0.038
    Release date: 2013-10-06. I have upgraded that from the file vendor and faced some problems that the files are not generated without errors.

    The function that creates the pdf report is function textSection($pdf) in pdf_create_function
  • khalidaou said:

    khalidaou said:

    I have developed an extend that generates pdf. The supported pdf format is old Version: 6.0.038
    Release date: 2013-10-06. I have upgraded that from the file vendor and faced some problems that the files are not generated without errors.

    The function that creates the pdf report is function textSection($pdf) in pdf_create_function
    I have returned the same TCPDF that comes with Gibbon v18.
  • You have worked on the Reporting module, right?

    You have reversed your changes regarding TCPDF, right?

    What is the problem now? What error message do you get?

    :)
  • meierrom said:

    You have worked on the Reporting module, right?

    You have reversed your changes regarding TCPDF, right?

    What is the problem now? What error message do you get?

    :)

    Yes, I have worked on the reporting module the problem that I get Questions marks instead of Arabic characters. The attached file shows the result.
  • You're right! Same here. It's a UTF-8 issue, apparently.

    Let me check it out. I'll get back to you as soon as I know more. :)
  • meierrom said:

    You're right! Same here. It's a UTF-8 issue, apparently.

    Let me check it out. I'll get back to you as soon as I know more. :)

    Thank you very much :smiley:
  • Ok, I was wrong. It wasn't a utf-8 issue.

    In my case it was simply a special character showing nicely in Gibbon but not being part of the font used by TCPDF, which is helvetica by default.

    @andystat informed me that choosing the right font is important. In your case helvetica seems not to work, which is not surprising.

    There are a number of fonts available in TCPDF. You will find them in the fonts folder which is vendor/tecnickcom/tcpdf/fonts.

    You should be able to find one that can work for you. Good luck :)
    admin
  • Dear khalidaou,

    Use freeserif font for your desired language.
  • meierrom said:

    Ok, I was wrong. It wasn't a utf-8 issue.

    In my case it was simply a special character showing nicely in Gibbon but not being part of the font used by TCPDF, which is helvetica by default.

    @andystat informed me that choosing the right font is important. In your case helvetica seems not to work, which is not surprising.

    There are a number of fonts available in TCPDF. You will find them in the fonts folder which is vendor/tecnickcom/tcpdf/fonts.

    You should be able to find one that can work for you. Good luck :)

    Thank you for replaying I have found that there are three fonts for arabic and they are

    $pdf->SetFont('freeserif', '', 14);
    $pdf->SetFont('aefurat','',16);
    $pdf->SetFont('aealarabiya','',16);

    according to https://youtu.be/Swy8TuA5fZw

    but it doesn't seems to work with the data from the database.

    Am recalling the data from the database and it shows question marks.
  • Dear khalidaou,

    Use freeserif font for your desired language.

    Thanks it should work with tcpdf but the data I recall from the database shows question marks.
  • I can edit the HTML codes and show Arabic characters as shown in the attached file.
  • The student name is also taken from db and it shows correctly, right?

    I do suspect an issue with the reporting table.

    I'll check that out later. :)
  • meierrom said:

    The student name is also taken from db and it shows correctly, right?

    I do suspect an issue with the reporting table.

    I'll check that out later. :)

    No, it is not from the database I wanted to know if the font from tcpdf shows Arabic characters so i have used the following to show it $html .=''.$this->officialName.'اللغة العربية';

    Thanks
  • I finally solved the problem I have changed the following:
    $html .= 'table, th, td{border: 1px solid black; border-collapse: collapse; font-family: Arial, Helvetica, sans-serif;}';

    to this:
    $html .= 'table, th, td{border: 1px solid black; border-collapse: collapse; font-family: aealarabiya;}';

    I didn't think that this will be related

    Thanks Dear @meierrom and @ghulamabbas92 for all the help.
  • Congrats! Well done! :)
  • Hello everyone, I know this issue has been resolved. I am just not sure where to change the font family. I have setup Gibbon at our school in China, so we have mixed English and Chinese comments, but I am having the same issue, that the Chinese characters are not generating in the reports. I have added the fonts onto the server, but not sure what I am doing wrong.
    Any help would be appreciated.
    Regards
    Celliers
Sign In or Register to comment.