Hi all,
I have discovered what appears to be a bug with CFDOCUMENT and am now looking
for some sort of workaround/hack/fix for it. I'm working on one right now, but
thought I'd share my test code with the community in case someone who is a
better coder than I can come up with a solution faster! :) (and there are
plenty of you out there I'm sure!)
See the code below: The result is that the background color of the column
header row and total rows bleed through the right border 1 pixel and the bottom
row bleeds through the bottom border 1 pixel as well.
<cfparam name="url.toPDF" default="false">
<!--- note: adding /testbug.pdf to the url below causes windows to display
that as the filename
when opening the PDF instead of testbug.cfm --->
<a href="testbug.cfm/testbug.pdf?toPDF=true">Export to PDF</a><br>
<cfsavecontent variable="sContent">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td style="background-color: #c0c0c0; border-left: 3px
solid black; border-top: 3px solid black; font-weight: bold;">COL Header 1</td>
<td style="background-color: #c0c0c0; border-left: 1px
solid black; border-top: 3px solid black; font-weight: bold;">COL Header 2</td>
<td style="background-color: #c0c0c0; border-left: 1px
solid black; border-top: 3px solid black; font-weight: bold;">COL Header 3</td>
<td style="background-color: #c0c0c0; border-left: 1px
solid black; border-top: 3px solid black; font-weight: bold;">COL Header 4</td>
<td style="background-color: #c0c0c0; border-left: 1px
solid black; border-top: 3px solid black; border-right: 3px solid black;
font-weight: bold;">COL Header 5</td>
</tr>
<cfloop from="1" to="5" index="rownum">
<tr>
<td style="border-left: 3px solid black; border-top:
1px solid black;">Data Row <cfoutput>#rownum#</cfoutput></td>
<td style="border-left: 1px solid black; border-top:
1px solid black;">Data Row <cfoutput>#rownum#</cfoutput></td>
<td style="border-left: 1px solid black; border-top:
1px solid black;">Data Row <cfoutput>#rownum#</cfoutput></td>
<td style="border-left: 1px solid black; border-top:
1px solid black;">Data Row <cfoutput>#rownum#</cfoutput></td>
<td style="border-left: 1px solid black; border-top:
1px solid black; border-right: 3px solid black;">Data Row
<cfoutput>#rownum#</cfoutput></td>
</tr>
</cfloop>
<tr>
<td style="background-color: #c0c0c0; border-left: 3px
solid black; border-top: 2px solid black; border-bottom: 3px solid
black;">Total Row</td>
<td style="background-color: #c0c0c0; border-left: 1px
solid black; border-top: 2px solid black; border-bottom: 3px solid
black;">Total Row</td>
<td style="background-color: #c0c0c0; border-left: 1px
solid black; border-top: 2px solid black; border-bottom: 3px solid
black;">Total Row</td>
<td style="background-color: #c0c0c0; border-left: 1px
solid black; border-top: 2px solid black; border-bottom: 3px solid
black;">Total Row</td>
<td style="background-color: #c0c0c0; border-left: 1px
solid black; border-top: 2px solid black; border-right: 3px solid black;
border-bottom: 3px solid black;">Total Row</td>
</tr>
</table>
</cfsavecontent>
<cfif url.toPDF>
<cfdocument format="PDF"
filename="#expandPath('testbug.pdf')#"
overwrite="true"
orientation="landscape"
scale="100"
pagewidth="10.5"
pageheight="8"
margintop=".25"
marginbottom=".25"
marginleft=".25"
marginright=".25"
>
<cfoutput>#sContent#</cfoutput>
</cfdocument>
<cfheader name="Content-Disposition"
value="attachment='#expandPath('testbug.pdf')#'">
<cfcontent file="#expandPath('testbug.pdf')#" type="application/pdf"
reset="yes">
<cfelse>
<cfoutput>#sContent#</cfoutput>
</cfif>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301194
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4