Whatever message this page gives is out now! Go check it out!
<p>This is a document rendered by the cfdocument tag.</p> </cfdocument> |
<h1>Employee List</h1> <!--- Inline query used for example purposes only. ---> <cfquery name="EmpList" datasource="cfdocexamples"> SELECT FirstName, LastName, Salary, Contract FROM Employee </cfquery> <cfoutput query="EmpList"> #EmpList.FirstName#, #EmpList.LastName#, #LSCurrencyFormat(EmpList.Salary)#, #EmpList.Contract#<br> </cfoutput> </cfdocument> |
<!--- Running header ---> <cfdocumentitem type="header"> <font size="-3"><i>Directory Report</i></font> </cfdocumentitem> <h3>cfdirectory Example</h3> <!--- Use cfdirectory to display directories by name and size ---> <cfdirectory directory="#GetDirectoryFromPath(GetTemplatePath())#" name="myDirectory" recurse="yes" sort="directory ASC, name ASC, size DESC"> <!---- Output the contents of the cfdirectory as a cftable -----> <cftable query="myDirectory" htmltable colheaders> <cfcol header="DIRECTORY:" text="#directory#"> <cfcol header="NAME:" text="#Name#"> <cfcol header="SIZE:" text="#Size#"> </cftable> </cfdocument> |
SELECT Emp_ID, firstname, lastname, e.dept_id, salary, d.dept_name FROM employee e, departmt d WHERE e.dept_id = d.dept_id ORDER BY d.dept_name </cfquery> <cfdocument format="PDF"> <cfoutput query="empSalary" group="dept_id"> <cfdocumentsection> <cfdocumentitem type="header"> <font size="-3"><i>Salary Report</i></font> </cfdocumentitem> <cfdocumentitem type="footer"> <font size="-3">Page #cfdocument.currentpagenumber#</font> </cfdocumentitem> <h2>#dept_name#</h2> <table width="95%" border="2" cellspacing="2" cellpadding="2" > <tr> <th>Employee</th> <th>Salary</th> </tr> <cfset deptTotal = 0 > <!--- inner cfoutput ---> <cfoutput> <tr> <td><font size="-1"> #empSalary.lastname#, #empSalary.firstname#</font> </td> <td align="right"><font size="-1"> #DollarFormat(empSalary.salary)#</font> </td> </tr> <cfset deptTotal = deptTotal + empSalary.salary> </cfoutput> <tr> <td align="right"><font size="-1">Total</font></td> <td align="right"><font size="-1">#DollarFormat(deptTotal)#</font></td> </tr> <cfset deptTotal = 0> </table> </cfdocumentsection> </cfoutput> </cfdocument> |
#cfdocument.totalpagecount#</cfdocumentitem> |
<cfdocumentitem type="header"> <font size="-1" align="center"><i>Building Better Applications</i></font> </cfdocumentitem> <cfdocumentitem type="footer"> <font size="-1"><i>Page <cfoutput>#cfdocument.currentpagenumber# of #cfdocument.totalpagecount#</cfoutput></i></font> </cfdocumentitem> <cfdocumentsection name="Introduction"> <h3>Introduction</h3> <p>The introduction goes here.</p> </cfdocumentsection> <cfdocumentsection name="Chapter 1"> <h3>Chapter 1: Getting Started</h3> <p>Chapter 1 goes here.</p> </cfdocumentsection> <cfdocumentsection name="Chapter 2"> <h3>Chapter 2: Building Applications</h3> <p>Chapter 2 goes here.</p> </cfdocumentsection> <cfdocumentsection name="Conclusion"> <h3>Conclusion</h3> <p>The conclusion goes here.</p> </cfdocumentsection> </cfdocument> |
<cfparam name="url.target_url" default="http://www.boston.com"> <cfoutput> <cfhttp url="#url.target_url#" resolveurl="yes"> <cfdocument format="FlashPaper"> <cfdocumentitem type="header"> <cfoutput>#url.target_url#</cfoutput> </cfdocumentitem> <cfdocumentitem type="footer"> <cfoutput>#cfdocument.currentpagenumber# / #cfdocument.totalpagecount#</cfoutput> </cfdocumentitem> <!--- Display the page ---> #cfhttp.filecontent# </cfdocument> </cfoutput> |
Security option | Description |
Encryption | Use the encryption attribute to specify whether PDF output is encrypted. Specify one of the following:
|
User password | Use the userpassword attribute to specify a password that users must enter to view the document. |
Owner password | Use the ownerpassword attribute to specify a password that users must enter to view and optionally modify the document. |
Permission | Description |
Printing | Specify the AllowPrinting attribute to enable viewers to print the document. |
Modification | Specify the AllowModifyContents attribute to let viewers modify the document, assuming they have the required software. |
Copy | Specify the AllowCopy attribute to let viewers select and copy text from the document. |
Annotation | Specify AllowModifyAnnotations to let viewers add comments to the document. If users add annotations, they must save the PDF after making changes. |
Screen readers | Specify AllowScreenReaders to enable access to the document through a screen reader. |
Fill in | Specify AllowFillIn to enable users to use form fields. |
Assembly | Specify AllowAssembly to enable users to create bookmarks and thumbnails, as well as insert, delete, and rotate pages. |
Degraded printing | Specify AllowDegradedPrinting to enable lower-resolution printing. This format prints each page as a bitmap, so printing can be slower. |
ownerpassword="us3rpa$$w0rd" userpassword="us3rpa$$w0rd" permissions="AllowCopy" > <h1>Employee List</h1> <cfquery name="EmpList" datasource="cfdocexamples"> SELECT FirstName, LastName, Salary FROM Employee </cfquery> <cfoutput query="EmpList"> #EmpList.FirstName#, #EmpList.LastName#, #LSCurrencyFormat(EmpList.Salary)#<br> </cfoutput> </cfdocument> |
tutorial application, found under the cfdocs directory. ---> <cfquery datasource="compasstravel" name="compasstrips"> SELECT tripName, tripDescription, tripLocation, price FROM trips ORDER BY price </cfquery> <cfdocument format="pdf" filename="#GetDirectoryFromPath(GetTemplatePath())#/compasstrips.pdf" overwrite="yes"> <cfdocumentsection> <h1 align="center">Compass Travel</h1> <h2 align="center">Destination Guide</h2> <p align="center"><img src="cfdocs/getting_started/photos/somewhere.jpg"></p> </cfdocumentsection> <cfdocumentsection> <cfdocumentitem type="header"> <font size="-3"> <i>Compass Travel Trip Descriptions</i></font> </cfdocumentitem> <cfdocumentitem type="footer"> <font size="-3"> <cfoutput>Page #cfdocument.currentpagenumber#</cfoutput> </font> </cfdocumentitem> <cfoutput query="compasstrips"> <hr> <h2>#tripName#</h2> <p><b>#tripLocation#</b></p> <p>Price: #DollarFormat(price)#</p> <p>#tripDescription#</p> </cfoutput> </cfdocumentsection> </cfdocument> |