Hi everyone,
I am using the CFDOCUMENT to create the traditional "print this page" method
from informational page of services. I am using this tag since CF7 and I would
say that I am use to it. since I am now using CF8, it seems that the tag change
a bit. I am not talking about the new features we can use with this tag (such
as CFDOCUMENTSECTION) but when I am using the CFDOCUMENTITEM to create my
"header", the font and the image are not show up as I asked. for an example, I
asked to display a text in the font-size 10pt while I display a text in the
footer with the font-size 8pt; the text from the footer is much bigger than the
text in the header! As for the logo of the company, it has 176 X 117 pixels but
it appears on the screen like a 50 X 30 pixels.
Is it something that I miss how to use this are of a CFDOCUMENT? And more
important for me, Am I the only one who got this problem?
Thank you for any assistance!
And here some code for the one of you who would like to see the details:
:confused;
<cfparam name="url.sid" default="0">
<cfif IsDefined("url.sid") AND IsNumeric(url.sid) AND url.sid GT 0>
<cfquery name="qGetServiceInfos" datasource="#application.DSN#">
SELECT ServiceName#session.lang# AS ServiceName,
ServiceWebDescription#session.lang# AS ServiceWebDescription, ServiceFamilyID
FROM SERVICE
WHERE SERVICEID = #url.sid#
</cfquery>
<cfquery name="qGetServiceFamily" datasource="#application.DSN#">
SELECT ServiceFamilyName#session.lang# AS ServiceFamilyName
FROM ServiceFamily
WHERE ServiceFamilyID = #qGetServiceInfos.ServiceFamilyID#
</cfquery>
<cfif qGetServiceInfos.RecordCount GT 0>
<cfdocument format="pdf" orientation="portrait" pagetype="letter">
<cfdocumentsection>
<cfdocumentitem type="header">
<cfoutput>
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="middle" width="300">
<img src="#Application.Root#/img/zerofail_logo.png"/>
</td>
<td align="right" valign="bottom">
<font face="Arial" style="font-size:10pt;"
color="##000000"><i>#qGetServiceFamily.ServiceFamilyName#</i></font>
</td>
<td width="15"> </td>
</tr>
<tr>
<td height="1" bgcolor="##000033" colspan="3"></td>
</tr>
</table>
</cfoutput>
</cfdocumentitem>
<cfoutput>
<table width-="100%" cellsspacing="1" cellpadding="3">
<tr>
<td align="left" valign="top">
<font face="Arial Black, Arial" style="font-size:14pt;"
color="##000000">#Replace(qGetServiceInfos.ServiceName,"<br>", " ")#</font>
</td>
<tr>
<td align="left" valign="top">
<font face="Arial"
color="##000000">#qGetServiceInfos.ServiceWebDescription#</font>
</td>
</tr>
</table>
</cfoutput>
<cfdocumentitem type="footer">
<cfoutput>
<table width="100%" cellspacing="0" cellpadding="0">
<cf_tableLine colspan="3">
<tr>
<td align="left" valign="top" width="30%">
<font face="Arial" style="font-size:6pt;">
<cfif session.lang is "fr">
Imprimé le #DateFormat(now(), "dd/mm/yyyy")#
<cfelse>
Printed on #DateFormat(now(), "d mmmm yyyy")#
</cfif>
</font>
</td>
<td align="center" valign="middle" width="40%">
<font face="Arial" color="##000000"
style="font-size:6pt;">www.zerofail.com</font>
</td>
<td align="right" valign="top" width="30%">
<font face="Arial" style="font-size:6pt;">
Page #cfdocument.currentpagenumber# / #cfdocument.totalpagecount#
</font>
</td>
</tr>
</table>
</cfoutput>
</cfdocumentitem>
</cfdocumentsection>
</cfdocument>
<cfelse>
<!--- Le système n'a pas pu trouver le service --->
<cfdocument format="pdf" orientation="portrait" pagetype="letter">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="right" valign="top">
<br>
<img src="#Application.Root#/img/zerofail_logo.jpg" width="136"
height="77"/>
</td>
</tr>
</table>
<table align="center" cellspacing="1" cellpadding="3">
<tr>
<td align="left" valign="top">
<cfif session.lang is "fr">
Nous sommes résolé mais le système n'a pas compris le service que vous
désirez imprimer. Veuillez fermer ce PDF et retouorner au site puis
recommencer. Si le problème persiste, veuillez contacter avec le Webmestre à
l'adresse suivante: webmaster@zerofail.com.
<cfelse>
We are sorry but the system did not understand which service's
information to display. Please close this PDF and try again from the web site.
If the problem persists, please contact the Webmaster at webmaster@zerofail.com.
</cfif>
</td>
</tr>
</table>
<cfdocumentitem type="footer">
<cfoutput>
<table width="100%" cellspacing="0" cellpadding="0">
<cf_tableLine colspan="3">
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td align="left" valign="top">
<font face="Arial" style="font-size:7pt;">
<cfif session.lang is "fr">
Imprimé le #DateFormat(now(), "dd/mm/yyyy")#
<cfelse>
Printed on #DateFormat(now(), "d mmmm yyyy")#
</cfif>
</font>
</td>
<td align="center" valign="middle">
<font face="Arial" color="##000000"
style="font-size:7pt;">www.zerofail.com</font>
</td>
<td align="right" valign="top">
<font face="Arial" style="font-size:7pt;">
Page #cfdocument.currentpagenumber# / #cfdocument.totalpagecount#
</font>
</td>
</tr>
</table>
</cfoutput>
</cfdocumentitem>
</cfdocument>
</cfif>
<cfelse>
<!--- Le système n'a pas pu trouver le service parce que le url.sid n'est pas
valide --->
<cfdocument format="pdf" orientation="portrait" pagetype="letter">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="right" valign="top">
<br>
<img src="#Application.Root#/img/zerofail_logo.jpg" width="136"
height="77"/>
</td>
</tr>
</table>
<table align="center" cellspacing="1" cellpadding="3">
<tr>
<td align="left" valign="top">
<cfif session.lang is "fr">
Nous sommes résolé mais le système n'a pas compris le service que vous
désirez imprimer. Veuillez fermer ce PDF et retouorner au site puis
recommencer. Si le problème persiste, veuillez contacter avec le Webmestre à
l'adresse suivante: webmaster@zerofail.com.
<cfelse>
We are sorry but the system did not understand which service's
information to display. Please close this PDF and try again from the web site.
If the problem persists, please contact the Webmaster at webmaster@zerofail.com.
</cfif>
</td>
</tr>
</table>
<cfdocumentitem type="footer">
<cfoutput>
<table width="100%" cellspacing="0" cellpadding="0">
<cf_tableLine colspan="3">
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td align="left" valign="top">
<font face="Arial" style="font-size:7pt;">
<cfif session.lang is "fr">
Imprimé le #DateFormat(now(), "dd/mm/yyyy")#
<cfelse>
Printed on #DateFormat(now(), "d mmmm yyyy")#
</cfif>
</font>
</td>
<td align="center" valign="middle">
<font face="Arial" color="##000000"
style="font-size:7pt;">www.zerofail.com</font>
</td>
<td align="right" valign="top">
<font face="Arial" style="font-size:7pt;">
Page #cfdocument.currentpagenumber# / #cfdocument.totalpagecount#
</font>
</td>
</tr>
</table>
</cfoutput>
</cfdocumentitem>
</cfdocument>
</cfif>
rupesh_kumar - 21 Aug 2007 19:31 GMT
It looks like your header content needs more space than the default top margin
space because of which it tries to scale it down to fit in this space. In cf7,
it does not scale it down and simply prints it on top of the main page which
leads to the chopping of the data in page. CF8 fixes that and hence it has to
scale down the header/footer content to fit it in the top/bottom margin
specified.
Please try out adjusting your margintop attribute and it should work fine.
cyber fyb - 17 Sep 2007 14:20 GMT
Thank you rupesh_kumar, I put margintop at 2 (for 2 inches) to the tag CFDOCUMENT and it "enlarged' the area and let me have the logo of the company appear with a more normal size.
;-))