Reputation: 1521
I am creating a footer in a PDF document using <cfdocumentitem type="footer">
and it is working fine. Except that I cannot seem to control the font. I have tried <span>
, <font face>
etc. with no luck. Currently I am trying a table with class as below.
Anyone know how to control the font look in a footer with <cfdocumentitem>
?
<cfdocument format="pdf"
marginBottom = ".5"
marginLeft = ".4"
marginRight = ".4"
marginTop = ".2"
>
<style type="text/css">@import "pdf.css";</style>
<cfdocumentitem type="footer">
<cfoutput>
<table width=100%>
<tr>
<td class=verd10>
<b>#pdfstuff.pdffinal#</b>
</td>
<td align=right class=verd10 valign=top>
Page #cfdocument.currentPageNumber# of #cfdocument.currentPageNumber#
</td>
</tr>
</table>
</cfoutput>
</cfdocumentitem>
pdf document data etc
</cfdocument>
Upvotes: 3
Views: 5862
Reputation: 2363
Try adding a copy of the stylesheet link inside the footer, like so:
<cfdocumentitem type="footer">
<style type="text/css">@import "pdf.css";</style>
<cfoutput>
<table>
... etc
</table>
</cfoutput>
</cfdocumentitem>
Upvotes: 1
Reputation: 4446
Welcome to cfdocument. The only way I have been able to successfully format any text in the footer is to use a combination of html and inline styles.
Here is a footer that works for me:
<cfdocumentItem type="footer">
<table width="100%">
<tr>
<td style="font-family:Arial; font-size: 9pt;">Printed On: #dateFormat(now(), "mm/dd/yyyy")# #timeFormat(now(), "HH:MM")#</td>
<td style="font-family:Arial; font-size: 9pt;" align="right">Page #cfdocument.currentPageNumber# of #cfdocument.totalPageCount#</td>
</tr>
</table>
</cfdocumentItem>
Upvotes: 1