Generating PDFs in Persian with PHP v4.3

  • Thread starter Thread starter Omid
  • Start date Start date
  • Tags Tags
    Php
Click For Summary
SUMMARY

The discussion centers on generating PDF files in Persian using PHP version 4.3. The user initially attempted to use PDFLIB but encountered issues with UNICODE support, resulting in nonsensical characters. After switching to UFPDF, the characters displayed correctly, but two problems persisted: characters were displayed separately instead of being connected, and the text order was left to right instead of the required right to left. The user seeks alternative classes that support UTF-8 and solutions to these formatting issues.

PREREQUISITES
  • Understanding of PHP 4.3 syntax and functionality
  • Familiarity with PDF generation libraries, specifically PDFLIB and UFPDF
  • Knowledge of UNICODE and UTF-8 encoding standards
  • Basic understanding of Persian language text formatting
NEXT STEPS
  • Research alternative PHP libraries for PDF generation that support UTF-8, such as TCPDF or FPDF
  • Learn about handling right-to-left text rendering in PDF documents
  • Explore character encoding issues in PHP and how to resolve them
  • Investigate the latest versions of PHP and their improvements in PDF handling
USEFUL FOR

PHP developers, particularly those working with multilingual applications, and anyone involved in generating PDF documents that require proper text formatting for languages like Persian.

Omid
Messages
181
Reaction score
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
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:
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:

Similar threads

Replies
3
Views
5K
Replies
29
Views
6K
Replies
35
Views
11K
  • · Replies 4 ·
Replies
4
Views
8K
  • · Replies 3 ·
Replies
3
Views
4K
  • Sticky
  • · Replies 2 ·
Replies
2
Views
507K