Copy link to clipboard
Copied
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
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!
Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
Strange issue. Thanks for sharing your answer.
Could you please also share a simple code sample with which we can reproduce the issue?
Copy link to clipboard
Copied
Hi BKBK,
I can post part of the code due to the company policy.
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
Copy link to clipboard
Copied
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>
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more