
December 11th, 2012, 11:12 PM
|
|
Contributing User
|
|
Join Date: May 2008
Posts: 117
Time spent in forums: 17 h 16 m 2 sec
Reputation Power: 6
|
|
As an aside, do not forget to VAR/LOCAL scope all of your function local variables. It is also a good practice to scope all variables ie "arguments.p1" instead of "p1".
Not tested, but something along these lines
Code:
<cffunction name="printPO" access="remote" output="false">
<cfargument name="p1" type="string" required="yes">
<cfset VAR replyStruct = StructNew()>
<cfset VAR poPdf = "">
<cfdocument format="pdf" name="poPdf">
<P>#arguments.p1#</P>
<h3><U>FROM:</U></h3>
<P>testcompany,<BR>
4 Smith Street,<BR>
Melbourne, Victoria,<BR>
Australia 3000<BR>
</cfdocument>
<cfprint source="poPdf" printer="hp LaserJet 4300">
<!--- "look Ma, no # signs" --->
<cfset replyStruct.status = "ALLOK">
<cfset replyStruct.param = arguments.p1>
<cfreturn replyStruct>
</cffunction>
|