ColdFusion 8 drops Arabic characters when generating PDF doc
- May 25, 2009
- 4 replies
- 4743 views
Hello All,
Please let me know what I'm doing wrong here! I have trouble with generating a PDF document from ColdFusion.
The cfm document contains mixed English and Arabic text and it seems that the ColdFusion's embedded PDF Generator drops Arabic characters when creating the PDF file.
I attached a bare bone cfm document (see print_test.cfm) that I used as an example to the stated problem.
The document:
- displays fine in FireFox 3.0.10 (see attached print_test_screenshot.jpg) Used link:
- http://localhost:8500/Print_test.cfm?display=yes
- This image file also shows the characters that get dropped by the ColdFusion's embedded PDF Generator.
- is converted fine in PDF by the FireFox 3.0.10 using print command line (see attached print_test_firefox.pdf) Used command:
- “C:\Program Files\Mozilla Firefox\firefox.exe" -print "http://localhost:8500/Print_test.cfm?display=yes" -printmode pdf -printfile "c:\pdf\print_test_firefox.pdf" -printdelay 150
- is NOT converted to PDF properly by the ColdFusion using the embedded PDF generator (see attached print_test_cf.pdf) Used command:
The print_test.cfm file, which I had to remove since this forum allows me to post only 3 attachments, has the following content:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<cfsavecontent variable="MyPage">
<head>
<title>PRINT TEST</title>
</head>
<body>
<table width="810" border="0">
<tr>
<td width="225" ><div align="center"><strong>ARABIC TEXT PRINT TEST</strong></div></td>
<td width="225" ><div align="center"><strong><span dir="rtl">نظام بصمة الوجه في دولة</span></strong></div></td>
</tr>
</table>
</body>
</html>
</cfsavecontent>
<cfif not(isdefined("url.DISPLAY"))>
<cfdocument format="pdf" filename="c:\pdf\print_test_cf.pdf" overwrite="yes">
<cfoutput>#mypage#</cfoutput>
</cfdocument>
<cfelse>
<cfoutput>#mypage#</cfoutput>
</cfif>
Thank you all for your help,
Adrian
