Prev: Coldfusion and WAP
Next: Itext Problem
From: RyanG24 on 1 Jan 2007 19:39 Hi ok thanks i have the hello world pdf working now so how do i now add the cfoutput below to the pdf? <table width="650" border="0"> <tr> <td height="382"> <table width="650" border="1" align="center" bordercolor="#000000"> <tr> <td bordercolor="#FFFFFF" bgcolor="#FFFFFF"><table width="650" border="0"> <cfoutput> <tr> <td width="500"> </td> <td rowspan="2" class="fixed34"><div align="right"> <cfif len(GetBusiness.BusinessLogo)> <cfoutput> <img src= images/#GetBusiness.BusinessLogo#> </cfoutput> </cfif></div></td> </tr> <tr> <td width="500" valign="bottom"><div align="left"><span class="style1">#GetCompany.Company_Name#</span></div></td> </tr> <tr> <td width="500"><div align="left"><span class="style1">#GetCompany.Address#</span></div></td> <td class="fixed34"><div align="left"><span class="style1">#GetBusiness.BusinessAddress#</span></div></td> </tr> <tr> <td width="500"><div align="left"><span class="style1">#GetCompany.Suburb#</span></div></td> <td class="fixed34"><div align="left"><span class="style1">#GetBusiness.BusinessSuburb#</span></div></td> </tr> <tr> <td width="500"><div align="left"><span class="style1">#GetCompany.State# #GetCompany.PostCode#</span></div></td> <td class="fixed34"><div align="left"><span class="style1">#GetBusiness.BusinessState# #GetBusiness.BusinessPostCode#</span> </div></td> </tr> <tr> <td width="500"><div align="left"><span class="style1">#GetCompany.ABN_No#</span></div></td> <td class="fixed34"><div align="left"><span class="style1">#GetBusiness.BusinessABN_No#</span></div></td> </tr> <tr> <td width="500"> </td> <td class="fixed34"> </td> </tr> <tr> <td colspan="2" class="style1">Date: #dateformat(now(), "dd/mm/yyyy")#</td> </tr></cfoutput> <tr> <td colspan="2"><div align="center" class="style2 style4">QUOTE No: SCH00<cfoutput>#NewQuoteNo#</cfoutput> </div></td> </tr> </table><table width="100%" border="0"> <tr bgcolor="#CCCCCC" class="style1"> <td class="fixed36"><div align="center"><strong>ITEM</strong></div></td> <td><div align="center" class="MainBlack"> <div align="left"><strong>DISCRIPTION</strong></div> </div></td> <td class="fixed36"><div align="center"><strong>UNIT PRICE </strong></div></td> <td class="fixed38"><div align="center"><strong>QTY</strong></div></td> <td class="fixed36"><div align="center"><strong>TOTAL</strong></div></td> </tr> <cfoutput query="GetQuoteItems"> <tr class="style1"> <td class="fixed36"><div align="center">#TempPartNo#</div></td> <td><div align="left">#TempDiscription#</div></td> <td class="fixed36"><div align="center">$#TempUnitPrice#</div></td> <td class="fixed38"><div align="center">#GetQuoteItems.Qty# </div></td> <td class="fixed36"><div align="right">$#DecimalFormat (TotalPrice)#</div></td> </tr></cfoutput> <tr class="style1"> <td class="fixed36"> </td> <td> </td> <td class="fixed36"> </td> <td class="fixed38"> </td> <td class="fixed36"> </td> </tr> <tr class="style1"> <td class="fixed36"> </td> <td> </td> <td class="fixed36"> </td> <td bgcolor="#FFFFFF" class="fixed38"><div align="center"> <div align="right" class="style1"><strong>TOTALS</strong></div> </div></td> <td bgcolor="#CCCCCC" class="fixed36"><div align="right">$<cfoutput>#DecimalFormat (GetTotals.TotalAllPrice)#</cfoutput></div></td> </tr> <tr class="style1"> <td class="fixed36"> </td> <td> </td> <td class="fixed36"> </td> <td class="fixed38"><div align="right" class="style1"><strong>GST</strong></div></td> <td bgcolor="#CCCCCC" class="fixed36"><div align="right">$<cfoutput>#DecimalFormat (GetTotals.TAXTOTAL)#</cfoutput></div></td> </tr> <tr class="style1"> <td class="fixed36"> </td> <td> </td> <td colspan="2"><div align="right" class="style1"><strong>TOTAL PAYABLE</strong></div></td> <td bgcolor="#CCCCCC" class="fixed36"><div align="right">$<cfoutput>#DecimalFormat (GetTotals.TOTALPAY)#</cfoutput></div></td> </tr> </table></td> </tr> </table> <table width="100%" border="0" align="center"> <tr> <td><div align="center" class="style3">Southern Cooling & Heating / Phone: <cfoutput>#GetBusiness.BusinessPhone#</cfoutput> / Web: <cfoutput>#GetBusiness.BusinessWeb#</cfoutput></div></td> </tr> </table> </td> </tr> </table>
From: BKBK on 2 Jan 2007 01:12 You can do it in 2 steps. First, render the table as PDF, thus <cfdocument format="pdf" filename="myTable.pdf" overwrite="yes"> [i]<table width="650" border="0"> <tr> <td height="382"> <!--- etc., etc. ---> <!--- etc., etc. ---> </td> </tr> </table>[/i] </cfdocument> If necessary, add style and page attributes to the tag to match those of Hello_World.pdf. Second, use http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1&catid=7&t hreadid=1114635 to join the two PDFs.
From: RyanG24 on 2 Jan 2007 03:00 hi thanks i cant use cfdocument though as the server is coldfusion 6.1?
From: BKBK on 3 Jan 2007 00:27
You could still create and merge PDFs on Coldfusion MX 6.1 using code similar to PaulH's or to this http://www.easycfm.com/forums/viewmessages.cfm?Forum=8&Topic=10035. You only have to install the iText jar file. Where the EasyCFM example adds a paragraph, you will add a table, using code like t = createObject("java","com.lowagie.text.Table").init(3,2); c1 = createObject("java","com.lowagie.text.Cell").init("cell data"); t.addCell(c1); ... ... ... pdfDocument.add(t); pdfDocument.close(); |