Adobe COLDFUSION 9 Manual page 33

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
The CFML Programming Language
<cfscript>
pdfObj = new pdf();
x = pdfObj.read(source=#sourcefile#, name="PDFInfo");
x = pdfObj.processddx(ddxfile="#tocddx#",inputfiles="#inputStruct#",outputfiles=
"#outputStruct#",name="ddxVar");
x = pdfObj.addWatermark(source="#pdf1#",image="#image1#", pages="1",
overwrite="yes", name="test2");
x = pdfObj.removewatermark(source="#pdf1#", name="temp");
x = pdfObj.deletePages(source="#destfolder#dest.pdf",pages="2-4", name="deltest");
pdfObj.addparam(source="#pdf1#", pages="1-2,4");
pdfObj.merge(destination="#destfolder#merge-oneBigFile-5.pdf", overwrite="yes");
pdfObj.thumbnail(source="#pdf1#", overwrite="yes");
pdfObj.setInfo(source="#pdf1#", info="#{Author="Donald Duck"}#",
destination="#destfolder#pdfinfo.pdf", overwrite="yes");
pdfObj.write(source="myBook", destination="#destfolder#write1.pdf", version="1.4",
overwrite="yes");
pdfObj.protect(source="MyPdfVar", password="adobe", permissions="none",
newuserpassword="newuserpw", newownerpassword="newownerpw");
</cfscript>
Storedproc example
The following code shows sample usage of the storedproc service object.
<cfscript>
sp = new storedproc();
<!---add cfprocparam tags --->
sp.addParam(TYPE = "IN", CFSQLTYPE="CF_SQL_VARCHAR", VALUE="David",
DBVARNAME="@firstname");
sp.addParam(TYPE="IN", CFSQLTYPE="CF_SQL_VARCHAR", VALUE="Peterson",
DBVARNAME="@lastname", null ="yes");
sp.add Param(TYPE="OUT", CFSQLTYPE="CF_SQL_INTEGER", variable="MyCount",
DBVARN AME="@MyCount");
<!---add cfprocresult
sp.addProcResult(NAME = "home r", RESULTSET = 1);
sp.addProcResult( NAME = "home r2", RESULTSET = 2);
sp.addProcResult(NAME = "home r3", RESULTSET = 3) ;
<!---execute stored proc--->
r = sp.execute(procedure="sp_weird",datasource="some_dsn",result="r");
writedump(r.getProcResultSets());
<!---changed from sp.getProcResults()--->
writedump(r.getProcResultSets ("home r3"));
writedump(r.getPrefix());
<!---changed from sp.getResult()--->
writedump(r.getProcOutVariables());
<!---changed from sp.getProcVars()--->
</cfscript>
The following are the available getters on the returned component:
getPrefix()
Returns the
cfstoredproc
getProcResultsets()
Returns any resultsets returned by the strored procedure.
getProcOutVariables(
tags --->
prefix (struct) available after the procedure has executed.
)
Last updated 8/5/2010
28

Advertisement

Table of Contents
loading

Table of Contents