How to create a PDF document in ColdFusion

cfdocument - create printable pdf format document

cfdocumentPDF.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfdocument tag: how to create printable pdf format document in coldfusion</title>
</head>

<body>

<cfquery name="qCourses" datasource="cfdocexamples" maxrows="10">
 SELECT Course_ID, Number, Descript from COURSES
</cfquery>

<cfdocument format="pdf">
    <h3 style="color:OrangeRed; font-style:italic">
        cfdocument example: Printable pdf document
    </h3>
 <cftable query="qCourses" colheaders="yes" htmltable="no" border="no">
     <cfcol header="Course ID" text="#Course_ID#" align="left">
     <cfcol header="Number" text="#Number#" align="left">
     <cfcol header="Description" text="#Descript#">
    </cftable>
</cfdocument>

</body>
</html>






More ColdFusion examples