Issue when we are using font calibri - It is not displayed in PDF
Copy link to clipboard
Copied
<cfhtmltopdf destination="FILEPATH" overwrite="true" orientation="portrait" unit="in" marginbottom="0.25" marginleft="0.25" marginright="0.25" margintop="0.25">
<cfprocessingdirective pageencoding="utf-8">
DISPLAYED IN PDF
<div style="font-family:calibri;font-size:13pt;">
THIS IS NOT DISPLAYING IN PDF
</div>
DISPLAYED IN PDF
</cfhtmltopdf>
We have installed calibri font. and coldfusion server: 2018.
Copy link to clipboard
Copied
A test to try:
- Place the cfprocessingdirective tag out of the cfhtmltopdf tag.
- Use calibri,sans-serif in place of calibri.
That is:
<cfprocessingdirective pageencoding="utf-8">
<cfhtmltopdf destination="FILEPATH" overwrite="true" orientation="portrait" unit="in" marginbottom="0.25" marginleft="0.25" marginright="0.25" margintop="0.25">
DISPLAYED IN PDF
<div style="font-family:calibri,sans-serif;font-size:13pt;">
THIS IS NOT DISPLAYING IN PDF
</div>
DISPLAYED IN PDF
</cfhtmltopdf>
Copy link to clipboard
Copied
Hi @BKBK
We are facing still same issue:
<cfhtmltopdf destination="FILEPATH" overwrite="true" orientation="portrait" unit="in" marginbottom="0.25" marginleft="0.25" marginright="0.25" margintop="0.25">
Start PDF
<div style="font-family:calibri,sans-serif;font-size:13pt;">
WELCOME
</div>
END PDF
</cfhtmltopdf>
PDF View Attached
Copy link to clipboard
Copied
Open the ColdFusion Administrator and go to Server Settings > Font Management. Are there Calibri fonts on the list? If so, which?
If any of the Calibri fonts is missing then google to find out how to install the font on your Operating System.. If you do, you will have to restart ColdFusion for the change to take effect.
Copy link to clipboard
Copied
Hi @BKBK
Yes we are using the same.
We are using CF 2018 Version:
Not sure whats the issue.. It is working for all other fonts.
Thank You
Copy link to clipboard
Copied
What happens when you add a space after the colon(:), like this:
<div style="font-family: calibri, sans-serif; font-size: 13pt;">
WELCOME
</div>
Copy link to clipboard
Copied
Something else to try
<span style="font-family: calibri, sans-serif; font-size: 13pt;">
WELCOME
</span>
Copy link to clipboard
Copied
Yet another idea
<cfsavecontent variable="divText" >
<div style="font-family: calibri,sans-serif;font-size: 13pt;">
WELCOME
</div>
</cfsavecontent>
<cfhtmltopdf destination="FILEPATH" overwrite="true" orientation="portrait" unit="in" marginbottom="0.25" marginleft="0.25" marginright="0.25" margintop="0.25">
Start PDF
<cfoutput>#divText#</cfoutput>
END PDF
</cfhtmltopdf>
Copy link to clipboard
Copied
When you installed the font in Windows, did you install it for "all users"? If the CF Service is running as another user, that might be an issue?
What happens when you open the PDF in Adobe Reader - does it display any messages about missing fonts?
Copy link to clipboard
Copied
@paule12345 's suggestion just gave me another idea. It might be that the problem arises because the Calibri font is not yet registered for use with ColdFusion. To test this hypothesis, proceed as follows:
- Go to the Font Management page in the ColdFusion Administrator: Server Settings > Font Management.
- Enter the value C:/Windows/Fonts/calibri.ttf into the input field "", and press the "Add" button. ColdFusion should confirm that the font has been added.
- Restart ColdFusion.
- Run your cfhtmltopdf test code.
Copy link to clipboard
Copied
Hi @BKBK and @paule12345
Sorry we still have same issue.. We are debugging more.
Thank You for your advice. I will update here if we found somthing strange.
Copy link to clipboard
Copied
Hi @pintuk86858408 , I have been able to show that this is unlikely to be a ColdFusion issue. I did it as follows.
- Download the ColdFusion 2018 installer for Windows from CFMLRepo. Install it on Windows 10 Pro.
- Save the following code as the file C:\ColdFusion2018\cfusion\wwwroot\calibriPdfTest.cfm
<cfhtmltopdf destination="C:\Users\BKBK\Desktop\FILEPATH.pdf" overwrite="true" orientation="portrait" unit="in" marginbottom="0.25" marginleft="0.25" marginright="0.25" margintop="0.25"> DISPLAYED IN PDF <div style="font-family:calibri;font-size:13pt;"> THIS IS THE LINE TO BE TESTED: IF IT APPEARS IN THE PDF, THEN THE TEST WILL HAVE SUCCEEDED. </div> DISPLAYED IN PDF </cfhtmltopdf> ​
- Launch in the browser: http://localhost:8501/calibriPdfTest.cfm
- Verify that the file FILEPATH.pdf has been saved on the desktop.
On inspecting the PDF, I can see that it contains the text within the div element. I have attached the resulting FILEPATH.pdf .
This test suggests that the cause of your problem is local to your environment.

