Skip to main content
November 7, 2011
Answered

cfpdf font size

  • November 7, 2011
  • 1 reply
  • 1442 views

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?

This topic has been closed for replies.
Correct answer -__cfSearching__-

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>

1 reply

-__cfSearching__-Correct answer
Inspiring
November 7, 2011

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>

November 7, 2011

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. 

Inspiring
November 7, 2011

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