Skip to main content
Participant
December 8, 2023
Question

Missing characters in Arabic PDF creation

  • December 8, 2023
  • 1 reply
  • 227 views

I am facing an issue while creating pdf using cfdocument tag where the content are Arabic characters. When I am printing the Arabic in web page(HTML) everything works fine, but when I put the same characters in pdf few ligature(joint letters) are missed out.

 

I have added the code below which creates the pdf in the same location where the file is run and display the content on screen. I have underlined the characters on screen display, which are missed out while rendering the texts in pdf. Is this a bug in cfdocument? Any help is much appreciated.

 

 

<cfprocessingdirective pageEncoding="utf-8">
<cfdocument name="TT" format="pdf" fontEmbed="Yes" margintop="1.1" marginbottom="0.5" backgroundVisible="Yes" pagetype="a4" orientation="portrait">
&#1575;&#1587;&#1605; &#1575;&#1604;&#1605;&#1575;&#1604;&#1603;<br>
&#1575;&#1604;&#1605;&#1576;&#1604;&#1594; &#1575;&#1604;&#1605;&#1587;&#1578;&#1581;&#1602; (&#1583;&#1585;&#1607;&#1605;)<br>
&#1585;&#1605;&#1586; &#1575;&#1604;&#1605;&#1578;&#1593;&#1575;&#1605;&#1604;<br>
&#1605;&#1585;&#1603;&#1586; &#1575;&#1604;&#1582;&#1583;&#1605;&#1577;<br>
</cfdocument>
 
 
<cfset currPath = expandPath("./") />
<cffile action="WRITE" nameconflict="overwrite" file="#currPath#TestArabic.pdf" output="#TT#" >
 
<font size="16" >&#1575;&#1587;&#1605; &#1575;<u>&#1604;&#1605;</u>&#1575;&#1604;&#1603;</font><br>
<font size="16" >&#1575;<u>&#1604;&#1605;</u>&#1576;&#1604;&#1594; &#1575;<u>&#1604;&#1605;</u>&#1587;&#1578;&#1581;&#1602; (&#1583;&#1585;&#1607;&#1605;)</font><br>
<font size="16" >&#1585;&#1605;&#1586; &#1575;<u>&#1604;&#1605;</u>&#1578;&#1593;&#1575;&#1605;&#1604;</font><br>
<font size="16" >&#1605;&#1585;&#1603;&#1586; &#1575;<u>&#1604;&#1582;</u>&#1583;&#1605;&#1577;</font><br><br>
 
**The underlined(ligature) characters are missing in pdf.
    This topic has been closed for replies.

    1 reply

    BKBK
    Community Expert
    Community Expert
    April 3, 2024

    I think you should use <cfhtmltopdf> instead of <cffile>. That is, something like

    <cfhtmltopdf destination="#currPath#TestArabic.pdf" overwrite="yes" >
    <font size="16" >&#1575;&#1587;&#1605; &#1575;<u>&#1604;&#1605;</u>&#1575;&#1604;&#1603;</font><br>
    <font size="16" >&#1575;<u>&#1604;&#1605;</u>&#1576;&#1604;&#1594; &#1575;<u>&#1604;&#1605;</u>&#1587;&#1578;&#1581;&#1602; (&#1583;&#1585;&#1607;&#1605;)</font><br>
    <font size="16" >&#1585;&#1605;&#1586; &#1575;<u>&#1604;&#1605;</u>&#1578;&#1593;&#1575;&#1605;&#1604;</font><br>
    <font size="16" >&#1605;&#1585;&#1603;&#1586; &#1575;<u>&#1604;&#1582;</u>&#1583;&#1605;&#1577;</font><br><br>
    </cfhtmltopdf>