Cfdocument takes a filename attribute if you want to save the resulting pdf
document to a file.  If it is omitted the content is streamed to the
browser.

_____ 

Jake Churchill 
Team Leader
11204 Davenport, Ste. 100
Omaha, NE  68154 
http://www.cfwebtools.com 
402-408-3733 x103 


-----Original Message-----
From: Bruce Sorge [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 24, 2007 1:00 PM
To: CF-Talk
Subject: CFDocument Question

I checked the docs and I don't think that this is possible, but I 
thought I would ask anyway.

Here is my code:
                <!--- Create the PDF document --->
                <cfdocument name="MasterSchedule" format="pdf">
                <!--- Create the header for each page --->
                <cfdocumentitem type="header">
                  <font size="3"><i><strong>Master Bus Route 
Report</strong></i></font>
                </cfdocumentitem>
                <!--- Output all of the schedules, grouping by the 
Route_ID --->
                    <cfoutput query="getAllRoutes" group="Route_ID">
                    <table align="center" cellpadding="0" 
cellspacing="0" border="0" width="100%">
                        <tr>
                            <th colspan="4">
                                
#School_Name#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                #Route_Name#
                             </th>
                         </tr>
                         <cfoutput>
                             <tr class="contacts_cell">
                                <td width="40%">
                                    #StreetName#
                              </td>
                              <td width="20%">
                                    (#Side#)
                              </td>
                              <td width="15%">
                                    #Pick_Up#
                              </td>
                              <td width="15%">
                                    #Drop_Off#
                              </td>  
                           </tr>
                        </cfoutput>
                    </table>
                </cfoutput>
                    </cfdocument>
                      <!--- Set the folder to save the document --->
                        <cfset savedFolder = 
expandPath("../pdf/MasterSchedule")>
                      <!--- Write the file to the named folder above --->
                        <cffile action="write" 
file="#savedFolder#/MasterSchedule.pdf" output="#MasterSchedule#" 
nameconflict="overwrite">
                      <!--- Output the PDF --->
                        <cfcontent type="application/pdf" reset="true" 
file="#savedFolder#/MasterSchedule.pdf">

What is happening is this. When the PDF outputs, the part with 
school_name and Route_Name is sometimes left hanging at the bottom of 
the page and then the corresponding schedule begins at the next page. 
What I want is that if this section is all that is left on the page, I 
want it to break at that point.

I know that CFDOCUMENT is a bit limited but I am hoping that I can at 
least do this.

Thanks,

Bruce



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Enterprise web applications, build robust, secure 
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289336
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to