Using the PDF class

The Pdf class is the proxy for the ColdFusion PDF service, which provides the functionality of the cfpdf tag. You specify the required cfpdf attributes for the action as Pdf tag attributes. The following examples show each supported action:

<!-- Get Info--> 
<cf:Pdf id="pdftest" action="GETINFO" 
source="http://localhost:8500/lcds26_devguide_040908.pdf"/> 
 
<!-- Delete Pages--> 
<cf:Pdf id="pdftest1" action="deletepages" 
source="http://localhost:8500/lcds26_devguide_040908.pdf" 
pages="1" resultHandler="handleDeleteResult" 
errorHandler="handleDeleteError"/> 
 
<!-- Merge files--><cf:Pdf id="pdftest" action="mergeFiles" 
source="http://localhost:8500/lcds26_devguide_040908.pdf, 
http://localhost:8500/EC205W_JoelGeraci.pdf" 
resultHandler="handleMergeResult" 
errorHandler="handleMergeError"/> 
 
<!-- extract pages--> 
<cf:Pdf id="pdftest" action="extractpages" 
source="http://localhost:8500/lcds26_devguide_040908.pdf" 
pages="2" keepBookmark="true" 
resultHandler="handleExtractResult" 
errorHandler="handleExtractError"/> 
 
<!-- addwatermark--> 
<cf:Pdf id="pdftest" action="addwatermark" 
source="http://localhost:8500/1page.pdf" 
image="http://localhost:8500/IMG_8680.JPG" 
resultHandler="handleExtractResult" 
errorHandler="handleExtractError"/> 
 
<!-- removewatermark--> 
<cf:Pdf id="pdftest" action="removewatermark" 
source="http://localhost:8500/CFFileServlet/ 
_cfservicelayer/_cf3466030530070122606.pdf" 
resultHandler="handleExtractResult" 
errorHandler="handleExtractError"/> 
 
<!-- protect--> 
<cf:Pdf id="pdftest" action="protect" 
source="http://localhost:8500/1page.pdf" 
newUserPassword="test" permissions="All" 
resultHandler="handleExtractResult" 
errorHandler="handleExtractError"/> 
 
<!-- mergespecificpages--> 
<cf:Pdf id="pdftest" action="mergespecificpages" 
pdfParam="{pdfparams}" keepBookmark="true" 
resultHandler="handleExtractResult" 
errorHandler="handleExtractError"/> 
 
<!-- set info--> 
<cf:Pdf id="pdftest" action="setinfo" 
source="http://localhost:8500/1page.pdf" info="{elements}" 
resultHandler="handleExtractResult" 
errorHandler="handleExtractError"/> 
 
<!-- thumbnail--> 
<cf:Pdf id="pdftest" action="thumbnail" 
source="http://localhost:8500/EC205W_JoelGeraci.pdf" 
resultHandler="handleThumbnailResult" 
errorHandler="handleThumbnailError"/> 
 
<!-- ProcessDDX--> 
<cf:Pdf id="pdftest" action="processddx" 
ddxString="{ddx}" outputFiles="{outputFiles}" result="handleProcessDDXResult" fault="handleProcessDDXError"/>