Copy link to clipboard
Copied
All,
I using the "addheader" part of cfpdf (which works fine) and am trying to increase the font size of the header text. I have successfully been able to change the font family to Arial and make the text bold, but cannot increase the size. I was able to use <cfsavecontent> like so:
<cfsavecontent variable="headerText">
<body style="font-family:Arial">
<b>Hello World</b>
</body>
</cfsavecontent>
<cfpdf
action="addheader"
source="mergedDoc"
name="myPDF"
showonprint="yes"
overwrite="yes"
text="#headerText#"
opacity="10"
topmargin="0.25"
rightmargin="5">
<cfcontent type="application/pdf" reset="yes" variable="#toBinary(myPDF)#">
I've tried various methods, but it will not increase the size. Ideas?
Maybe there is a problem with your css, because adding a font-size should do it:
<cfsavecontent variable="headerText">
<span style="font-size: 25pt; font-family: Arial;color: #0080ff;font-weight: bold;">
LARGER TEXT
</span>
</cfsavecontent>
Copy link to clipboard
Copied
Maybe there is a problem with your css, because adding a font-size should do it:
<cfsavecontent variable="headerText">
<span style="font-size: 25pt; font-family: Arial;color: #0080ff;font-weight: bold;">
LARGER TEXT
</span>
</cfsavecontent>
Copy link to clipboard
Copied
Thanks cfSearching. I've actually used that code before (minus using font-weight: bold), however, my font-size attribute defaults to px instead of pt (using Dreamweaver CS5.5). For whatever reason, it would error out each time I tried it; therefore, I assumed it didn't like the font-size attribute itself.
Looks like cfsavecontent only accepts pt and not px. You think this is a bug? I'm gonna do more testing tomorrow before I push to production, but this seems to work.
Copy link to clipboard
Copied
Just a guess but cfpdf might be using ddx to create the header. IIRC, ddx only supports a subset of elements and css. So maybe it just does not support the unit "px", only ones like "pt".
-Leigh