Listing 1:  MyBusinessForm.cfm

<!section 1 -->
<cfloop index="x" list="#form.fieldnames#">
	<cfif #x# is not "submit">
		<cfoutput>#x# = #form[x]#</cfoutput> <br>
		<!--- screen output --->
	</cfif>
</cfloop>

<cfquery name="dbInsert" datasource="myDSN">
	insert into GMAtable
	(ADDRESS, BUSINESSNAME, CITY, EADDRESS,
	NAME, STATE, TITLE, TRAININGSUBJECTS, ZIP)
	values
	('form.ADDRESS', 'form.BUSINESSNAME', 'form.CITY', 'form.EADDRESS',
	'form.NAME', 'form.STATE', 'form.TITLE', 'form.TRAININGSUBJECTS', 'form.ZIP')
</cfquery>


<! section 2 ------>
<!--- Instantiate the APToolkit object. --->
<CFOBJECT ACTION="Create" TYPE="COM" CLASS=APToolkit.Object NAME="PDF">

<cftry>
	<cfset u = PDF.OpenInputFile(ExpandPath("MyBusinessForm.pdf"))>
	<!--- Assign a handle to the image file, which is named with a uniqueID --->
	<cfset strfilename = (ExpandPath(PDF.getuniquefilename(1)))>
	<cfset n = PDF.OpenOutputFile(#strfilename#)>

	<cfloop index="x" list="#form.fieldnames#">
		<cfif (#x# is not "submit")> 
			<!--- calls object to assign form values: --->
			<cfset PDF.SetFormFieldData(#x#, #form[x]#, -998)>
		</cfif>
	</cfloop>

	<!--- Remove the reset and submit buttons --->
	<cfset PDF.DeleteFormField ("reset")>
	<cfset PDF.DeleteFormField ("submit")>

	<!--- Copy the values from the variables assigned above to the image file --->
	<cfset u = PDF.CopyForm(0,0)>

	<!--- Close the image file  --->
	<cfset u = PDF.CloseOutputFile()>

	<!--- Send the submitted form (image file) via email attachment --->
	<cfmail
		to="tim.burton@odot.state.or.us"
		from="WEBMAILERR@odot.state.or.us"
		subject="New PDF form was submitted."
		mimeattach = #strfilename#>
	</cfmail>

	<!--- If the user wants a copy of the PDF by filling in a form field with
	their own email address (the form field must be named 'EADDRESS'):   --->
	<cfif IsDefined("Form.EADDRESS")>
		<cfmail
			to="#Form.EADDRESS#"
			from="WEBMAILERR@odot.state.or.us"
			subject="Copy of your PDF form."
			mimeattach = #strfilename#>
		</cfmail>
	</cfif>

	<!--- Delete the constructed image file   --->
	<cffile action = "delete" file = "#strfilename#">

	<!--- Destroy the object in CF v4.5. --->
	<cfset PDF = "">

	<div align="center">
		<br><b>The form has been submitted.  Thank you.</b><br><br>
	</div>

	<cfcatch type="Any">
		<!--- error handling here--->
		<cfabort>
	</cfcatch>
</cftry>