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

The font size inside a .css working in lower env, but seems not working in PROD

Explorer ,
Jun 13, 2025 Jun 13, 2025

Hi experts, 

I have an issue with the font size in a pdf file that was generated by .cfm files. With the same .cfm files and .css ( baaically the codes are identical), the font size  in the generated report pdf file looks different in UAT and production.  I am thinking that it could be that .css is not production environment. It works in lower environment because I changed the font size in .css, it reflects in the generated pdf file.

Is it possible that the Admin Control has some settings to control that?

in a.css file: td.L1 {
font-size : 8pt;

In .cfm file:

<link rel="stylesheet" type="text/css" href="css/a.css">

 

Thanks very much,

Jc

500
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

correct answers 1 Correct answer

Explorer , Jun 13, 2025 Jun 13, 2025

Update: on PROD server, we copied the content of .css, and put into the .cfm file, then it works.  That make me wondering why the font size inside of .css in lower inviroment works. I am 100% sure it works because I changed the font inside .css, and then I saw the font size in the report in lower environment.  Still a mistery!

Translate
Explorer ,
Jun 13, 2025 Jun 13, 2025

Update: on PROD server, we copied the content of .css, and put into the .cfm file, then it works.  That make me wondering why the font size inside of .css in lower inviroment works. I am 100% sure it works because I changed the font inside .css, and then I saw the font size in the report in lower environment.  Still a mistery!

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 ,
Jun 15, 2025 Jun 15, 2025

Strange issue. Thanks for sharing your answer.

Could you please also share a simple code sample with which we can reproduce the issue? 

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
Explorer ,
Jun 15, 2025 Jun 15, 2025

Hi BKBK,

I can post part of the code due to the company policy.

<html>
<meta http-equiv="Pragma" content="no-cache">
<head>
<link rel="stylesheet" type="text/css" href="css/Portfolio.css">
<style>
 
 
</style>.
.
.
<cfdocument format="PDF" name="pdfInput" orientation="landscape" marginleft="0.25" marginright=".25" margintop="0.25" >
<cfset previous_prn = 0>
<cfloop index="ListElement" list="#FIELDNAMES#" delimiters=",">
<cfoutput>
<cfif #ListElement# neq "RECORDNO">
<cfif #Left(ListElement,2)# eq "YA">
<cfif previous_prn eq 1>
<cfdocumentitem type="pagebreak" />
<cfelse>
<cfset previous_prn = 1>
</cfif>
 
<cfset WatchlistNo = #Evaluate(ListElement)#>
<cfinclude template="anotherfile_print.cfm">
</cfif>
</cfif>
</cfoutput>
</cfloop>
</cfdocument>
 
<cfset tfooter = "xxxxxx">
 
<!--- Add Page X of Y Footers ---> 
<cfpdf action="addFooter"
   source="pdfInput"  
   name="pdfOutput"  
   align="right"
   text="#tfooter#"
   showonprint = "true" 
/>
 
<!--- Display results --->  
<cfcontent type="application/pdf" variable="#ToBinary(pdfOutput)#" />
 
Above is part of the code. It uses <cfdocument> and <cfcontent> to generate output as a pdf file.

Basically,  I have to copy the block below from Portfolio.css, and paste into <style> block directly in the .cfm file. 

=========

td.L1 {
font-size : 8pt;
}

 

***************************

Update:  I heard now PROD works without change after re-deployment. I do not know why, but if someone encounters the same issue, and no solution, then this might help.

Thanks,

Jc

 

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 ,
Jun 17, 2025 Jun 17, 2025

Where is the rest of the HTML? From what I can see, there is HTML outside the cfdocument tag. But all the HTML, including the style, should actually be inside the cfdocument tag.

 

Something like this:

<cfdocument format="PDF" name="pdfInput" orientation="landscape" marginleft="0.25" marginright=".25" margintop="0.25" >
<html>
<meta http-equiv="Pragma" content="no-cache">
<head>
<link rel="stylesheet" type="text/css" href="css/Portfolio.css">
<style>
</style>

<!---
etcetera
--->

<body>
<cfset previous_prn = 0>
<cfloop index="ListElement" list="#FIELDNAMES#" delimiters=",">
<cfoutput>
<cfif #ListElement# neq "RECORDNO">
<cfif #Left(ListElement,2)# eq "YA">
<cfif previous_prn eq 1>
<cfdocumentitem type="pagebreak" />
<cfelse>
<cfset previous_prn = 1>
</cfif>
 
<cfset WatchlistNo = #Evaluate(ListElement)#>
<cfinclude template="anotherfile_print.cfm">
</cfif>
</cfif>
</cfoutput>
</cfloop>

<!---
etcetera
--->

</body>
</html>
</cfdocument>

 

 

 

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
Explorer ,
Jun 18, 2025 Jun 18, 2025

Hi BKBK, 

The html code is inside the file anotherfile_print.cfm. As you pointed out, it is inside <document> block. Since the issue is gone in PROD without any change, and never an issue in dev, so it is not a concern anymore. Should the issue occurs again, I might replace <cfcontent>with <cfsavecontent>, to see if it can be a solution. 

Thanks a lot for your help!

Jc

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 ,
Jun 18, 2025 Jun 18, 2025
LATEST

In the earlier post, the following code is outside the cfdocument tag:

<html>
<meta http-equiv="Pragma" content="no-cache">
<head>
<link rel="stylesheet" type="text/css" href="css/Portfolio.css">
<style>
 
 
</style>.
.
.

Anyway, it really doesn't matter now, as the issue is gone.

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