Skip to main content
Inspiring
June 13, 2025
Answered

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

  • June 13, 2025
  • 1 reply
  • 470 views

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

    Correct answer Enchanted_vibrancy5464

    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!

    1 reply

    Enchanted_vibrancy5464AuthorCorrect answer
    Inspiring
    June 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!

    BKBK
    Community Expert
    Community Expert
    June 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? 

    Inspiring
    June 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