Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Issue when we are using font calibri - It is not displayed in PDF

New Here ,
May 06, 2024 May 06, 2024
We are using cfhtmltopdf and inside calibri font block, content is not displaying in PDF
 

 

<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.

TOPICS
Server administration
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 07, 2024 May 07, 2024

A test to try:

  1. Place the cfprocessingdirective tag out of the cfhtmltopdf tag.
  2.  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>

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 08, 2024 May 08, 2024

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

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 08, 2024 May 08, 2024

Open the ColdFusion Administrator and go to Server Settings > Font Management. Are there Calibri fonts on the list? If so, which?

BKBK_0-1715211753046.pngexpand image

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 09, 2024 May 09, 2024

Hi @BKBK 

 

Yes we are using the same.
Font-Management.pngexpand image

We are using CF 2018 Version:
CF-Version.pngexpand image

Not sure whats the issue.. It is working for all other fonts. 

 

Thank You

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 09, 2024 May 09, 2024

What happens when you add a space after the colon(:), like this:

<div style="font-family: calibri, sans-serif; font-size: 13pt;">
    WELCOME
</div>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 09, 2024 May 09, 2024

Something else to try

<span style="font-family: calibri, sans-serif; font-size: 13pt;">
    WELCOME
</span>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 09, 2024 May 09, 2024

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>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 09, 2024 May 09, 2024

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?

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 10, 2024 May 10, 2024

@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:

  1.  Go to the Font Management page in the ColdFusion Administrator: Server Settings > Font Management
  2.  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.
  3.  Restart ColdFusion.
  4.  Run your cfhtmltopdf test code.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 14, 2024 May 14, 2024

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. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 15, 2024 May 15, 2024
LATEST

Hi @pintuk86858408 , I have been able to show that this is unlikely to be a ColdFusion issue. I did it as follows.

 

  1.  Download the ColdFusion 2018 installer for Windows from CFMLRepo. Install it on Windows 10 Pro.
  2.  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>
    ​
  3.  Launch in the browser: http://localhost:8501/calibriPdfTest.cfm
  4.  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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources