Generating PDFs in Persian with PHP v4.3

  • Thread starter Omid
  • Start date
  • Tags
    Php
In summary, the conversation discusses the need to generate PDF files in Persian using PHP codes. The server being used is running on version 4.3 and the PDFLIB does not support UNICODE, resulting in nonsensical characters being displayed when writing in Persian. The speaker has also tried using the UFPDF class, which displays characters correctly but still has two problems. The first problem is that Persian characters are not separated properly in the PDF, and the second problem is that the order of characters is left to right instead of right to left. The speaker asks for any other classes that support UTF-8 or advice to solve the two problems. They are reminded to always check the documentation and are directed to a specific page for more information. The
  • #1
Omid
182
0
I need to generate PDF files in Persian. My codes are in PHP and the server is runnig ver 4.3. The PDFLIB appearently doesn't support UNICODE. When I write something in Persian it shows only some nonsence charachters on screen. I also downloaded UFPDF, after using that class the charachters were shown correctly but still I have 2 problems:
1. In persian in contrast to english the charachters are sticked togheter but the PDF, shows them seprated.
2. The order in the PDF is left to right while it must become right to left.

Do you know any other classes which support UTF-8?
Or any advice to solve the 2 problems?
Thanks
 
Computer science news on Phys.org
  • #2
Always check the documenation. Do a search on the page for UTF-8

http://php.mirrors.ilisys.com.au/manual/en/function.pdf-findfont.php
 
Last edited by a moderator:
  • #3
I did, but not as well as you :D
You know, all the php guys in Iran (www.Iranphp.net[/URL]) are killing themselves to solve the problem then I didn't think taking a look at the documatation would be useful.
Anyway, I'm going to check it now.
Thank you.
 
Last edited by a moderator:

FAQ: Generating PDFs in Persian with PHP v4.3

How can I generate a PDF in Persian using PHP v4.3?

To generate a PDF in Persian using PHP v4.3, you will need to install the mPDF library and set the default encoding to UTF-8 in your PHP code. Then, you can use the mPDF functions to convert your Persian text into a PDF file.

Can I add images and graphics to my PDF in Persian using PHP v4.3?

Yes, you can add images and graphics to your PDF in Persian using PHP v4.3. The mPDF library supports various image formats and offers functions to add images to your PDF document.

Is it possible to customize the font and layout of my PDF in Persian using PHP v4.3?

Yes, you can customize the font and layout of your PDF in Persian using PHP v4.3. The mPDF library allows you to specify the font style, size, and color for your text, as well as adjust the page margins and layout.

Can I generate multiple pages in my PDF in Persian using PHP v4.3?

Yes, you can generate multiple pages in your PDF in Persian using PHP v4.3. The mPDF library offers functions to add new pages and control the page numbering in your PDF document.

Are there any limitations to generating PDFs in Persian with PHP v4.3?

There may be limitations to generating PDFs in Persian with PHP v4.3 depending on the capabilities of the mPDF library. It is important to check the library's documentation for any potential limitations or conflicts with your specific project needs.

Similar threads

Back
Top