<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>LiveCycle Blog</title>
    <link rel="alternate" type="text/html" href="http://blogs.adobe.com/livecycleblog/" />
    <link rel="self" type="application/atom+xml" href="http://blogs.adobe.com/livecycleblog/atom.xml" />
   <id>tag:blogs.adobe.com,2009:/livecycleblog/246</id>
    <link rel="service.post" type="application/atom+xml" href="http://blogs.adobe.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=246" title="LiveCycle Blog" />
    <updated>2008-08-01T18:18:23Z</updated>
    <subtitle>Leveraging Adobe LiveCycle - Air, Flex, ColdFusion</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 3.38</generator>
 
<entry>
    <title>Invoking Output Service (transformPDF) via SOAP</title>
    <link rel="alternate" type="text/html" href="http://blogs.adobe.com/livecycleblog/2008/08/invoking_output_service_transf_2.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://blogs.adobe.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=246/entry_id=6796" title="Invoking Output Service (transformPDF) via SOAP" />
    <id>tag:blogs.adobe.com,2008:/livecycleblog//246.6796</id>
    
    <published>2008-08-01T18:12:38Z</published>
    <updated>2008-08-01T18:18:23Z</updated>
    
    <summary>This tutorial provides a simple example of how to call a LiveCycle service from ColdFusion using SOAP. The article specifically calls the transFormPDF method of the OutputService, however provides the basics for calling any service. Normally the preferred method of...</summary>
    <author>
        <name>Allen Levine</name>
        
    </author>
            <category term="ColdFusion" />
            <category term="Output Service" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.adobe.com/livecycleblog/">
        <![CDATA[<p>This tutorial provides a simple example of how to call a LiveCycle service from ColdFusion using SOAP. The article specifically calls the transFormPDF method of the OutputService, however provides the basics for calling any service. <br /><br />Normally the preferred method of invoking LiveCycle services from ColdFusion is probably using the EJB, sometimes this can be difficult and SOAP provides a simple solution, although not the most robust. <br /><br />Using the SOAP enoint requires knowledge of the specific WSDL file for the desired service. A list of WSDL file locations can be found <a href="http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/wwhelp/wwhimpl/common/html/wwhelp.htm?context=help&amp;file=000885.html" target="_blank">here</a>. <br /><br />transformPDF.cfm <br />&lt;!--- Change OutputServiceURL to match your environment ---&gt; <br />&lt; cfset OutputServiceURL = &quot;http://127.0.0.1:8080/soap/services/OutputService?wsdl&quot;&gt; <br /><br />&lt;!--- Change SourceFileName to point to a PDF Form ---&gt; <br />&lt;cfset SourceFileName = &quot;C:\Temp\Test.pdf&quot;&gt; <br /><br />&lt;!--- Convert the PDF Form to Binary, BASE64 ---&gt; <br />&lt;cffile action=&quot;READBINARY&quot; file=&quot;#SourceFileName#&quot; variable=&quot;sourcePDF&quot;&gt; <br />&lt;cfset binaryData = ToBase64(sourcePDF, &quot;iso-8859-1&quot;)&gt; <br /><br />&lt;cfoutput&gt;<br />&lt;CFSAVECONTENT VARIABLE=&quot;SoapRequestXML&quot;&gt; <br />&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:SOAP-ENC=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;<br />&lt;SOAP-ENV:Body&gt;<br />&lt;m:transformPDF xmlns:m=&quot;http://adobe.com/idp/services&quot;&gt;<br />&lt;m:inPdfDoc&gt;<br />&lt;m:contentType&gt;String&lt;/m:contentType&gt;<br />&lt;m:binaryData&gt;#binaryData#&lt;/m:binaryData&gt;<br />&lt;m:attachmentID&gt;String&lt;/m:attachmentID&gt;<br />&lt;m:remoteURL&gt;String&lt;/m:remoteURL&gt;<br />&lt;/m:inPdfDoc&gt;<br />&lt;m:transformationFormat&gt;PDF&lt;/m:transformationFormat&gt;<br />&lt;m:pdfaRevisionNumber&gt;Revision_1&lt;/m:pdfaRevisionNumber&gt;<br />&lt;m:pdfaAmendment&gt;String&lt;/m:pdfaAmendment&gt;<br />&lt;m:pdfaConformance&gt;A&lt;/m:pdfaConformance&gt;<br />&lt;/m:transformPDF&gt;<br />v/SOAP-ENV:Body&gt;<br />&lt;/SOAP-ENV:Envelope&gt;<br />&lt;/CFSAVECONTENT&gt; <br />&lt;/cfoutput&gt; <br /><br />&lt;!--- Invoke the Web Service ---&gt;<br />&lt;cfhttp url=&quot;#OutputServiceURL#&quot; method=&quot;POST&quot; username=&quot;administrator&quot; password=&quot;password&quot;&gt;<br />&lt;cfhttpparam type=&quot;CGI&quot; name=&quot;SOAPAction&quot; value=&quot;transformPDF&quot;&gt;<br />&lt;cfhttpparam type=&quot;XML&quot; name=&quot;transformPDFRequest&quot; value=&quot;#SoapRequestXML#&quot;&gt;<br />&lt;/CFHTTP&gt; <br /><br />&lt;!--- Parse the Result ---&gt;<br />&lt;cfset SoapResponseXML = #cfhttp.filecontent#&gt;<br />&lt;cfset SoapResponseXML = xmlParse(SoapResponseXML)&gt;<br />&lt;cfset theRoot = SoapResponseXML.XmlRoot&gt;<br />&lt;cfset readerEnabledPDF = '#theRoot.XmlChildren[1].XmlChildren[1].XmlChildren[1][&quot;remoteURL&quot;].XmlText#'&gt; <br /><br />&lt;cfoutput&gt;<br />&lt;a href=&quot;#readerEnabledPDF#&quot; target=&quot;_blank&quot;&gt;Transformed PDF&lt;/a&gt;<br />&lt;/cfoutput&gt; <br /><br />You can also download the source here <a href="http://blogs.adobe.com/livecycleblog/assets/transformPDF.txt" target="_blank">Download Source</a></p>]]>
        
    </content>
</entry>
<entry>
    <title>Invoking Output Service (transformPDF) via EJB</title>
    <link rel="alternate" type="text/html" href="http://blogs.adobe.com/livecycleblog/2008/08/invoking_output_service_transf.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://blogs.adobe.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=246/entry_id=6795" title="Invoking Output Service (transformPDF) via EJB" />
    <id>tag:blogs.adobe.com,2008:/livecycleblog//246.6795</id>
    
    <published>2008-08-01T17:45:43Z</published>
    <updated>2008-08-01T17:52:03Z</updated>
    
    <summary>This sample provides the basics for invoking the transformPDF method of the LiveCycle OutputService. This sample assumes you are using LiveCycle on Jboss. If you are using a different Java server, you will need to modify a few paramaters, but...</summary>
    <author>
        <name>Allen Levine</name>
        
    </author>
            <category term="ColdFusion" />
            <category term="Output Service" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.adobe.com/livecycleblog/">
        <![CDATA[<p>This sample provides the basics for invoking the transformPDF method of the LiveCycle OutputService. <br /><br />This sample assumes you are using LiveCycle on Jboss. If you are using a different Java server, you will need to modify a few paramaters, but the basics are the same. <br /><br />The transformPDF service transforms a interactive PDF (PDF Form) to a non-interactive PDF. <br /><br /><strong>Environment Setup</strong><br />1. Copy the following required jar files from your LiveCycle Installation to your {ColdFusion Install Directory}\wwwroot\WEB-INF\lib.<br />jbossall-client.jar [C:\Adobe\LiveCycle8\jboss\client]<br />adobe-utilities.jar [C:\Adobe\LiveCycle8\LiveCycle_ES_SDK\client-libs\jboss]<br />adobe-output-client [C:\Adobe\LiveCycle8\LiveCycle_ES_SDK\client-libs\common]<br />adobe-usermanager-client [C:\Adobe\LiveCycle8\LiveCycle_ES_SDK\client-libs\common]<br />adobe-livecycle-client [C:\Adobe\LiveCycle8\LiveCycle_ES_SDK\client-libs\common] <br /><br />2. Restart ColdFusion Application Service <br /><br />transformPDF_EJB.cfm<br />&lt;!---<br />Modify these three variables to match your environment<br />** Be sure the fileInput is a PDF Form<br />---&gt; <br />&lt;cfset EJB_ENDPOINT = &quot;jnp://68.175.120.115:1099&quot;&gt;<br />&lt;cfset fileInput = &quot;C:\temp\test.pdf&quot;&gt;<br />&lt;cfset fileOutput = &quot;C:\temp\output.pdf&quot;&gt;<br /><br />&lt;cfscript&gt;<br />// Create ServiceClientFactoryProperties<br />serviceClientFactoryProperties = CreateObject(&quot;java&quot;,&quot;com.adobe.idp.dsc.clientsdk.ServiceClientFactoryProperties&quot;);<br />connectionProps = CreateObject(&quot;java&quot;,&quot;java.util.Properties&quot;).init();<br />connectionProps.setProperty(serviceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, EJB_ENDPOINT);<br />connectionProps.setProperty(serviceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL, serviceClientFactoryProperties.DSC_EJB_PROTOCOL);<br />connectionProps.setProperty(serviceClientFactoryProperties.DSC_SERVER_TYPE, &quot;Jboss&quot;);<br />connectionProps.setProperty(serviceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, &quot;administrator&quot;);<br />connectionProps.setProperty(serviceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, &quot;password&quot;);<br />&lt;/cfscript&gt; <br /><br />&lt;cfscript&gt;<br />// Initialize ServiceClientFactory with serviceClientFactoryProperties<br />myFactory = CreateObject(&quot;java&quot;,&quot;com.adobe.idp.dsc.clientsdk.ServiceClientFactory&quot;).createInstance(connectionProps);<br /><br />// Initialize FileInputStream with fileInput Variable<br />fileInputStream = CreateObject(&quot;java&quot;,&quot;java.io.FileInputStream&quot;).init(fileInput);<br /><br />// Initialize OutputClient with ServiceClientFactory properties<br />outClient = CreateObject(&quot;java&quot;,&quot;com.adobe.livecycle.output.client.OutputClient&quot;).init(myFactory);<br /><br />// Set inPDF Document<br />inPDF = CreateObject(&quot;java&quot;,&quot;com.adobe.idp.Document&quot;).init(fileInputStream);<br /><br />// Set outPDF Document For Result Handling<br />outPDF = CreateObject(&quot;java&quot;,&quot;com.adobe.idp.Document&quot;);<br /><br />// transformPDF Parameter Settings: You can avoid these properties and simply cast nulls as in the commented invoke below<br />TransformationFormat = CreateObject(&quot;java&quot;,&quot;com.adobe.livecycle.output.client.TransformationFormat&quot;);<br />PDFARevisionNumber = CreateObject(&quot;java&quot;,&quot;com.adobe.livecycle.output.client.PDFARevisionNumber&quot;);<br />PDFAConformance = CreateObject(&quot;java&quot;,&quot;com.adobe.livecycle.output.client.PDFAConformance&quot;);<br /><br />// Initiate The transformPDF Method<br />outPDF = outClient.transformPDF(inPDF,TransformationFormat.PDF,PDFARevisionNumber.Revision_1,&quot;&quot;,PDFAConformance.A);<br />// If you want to use null make sure you JavaCast<br />//outPDF = outClient.transformPDF(inPDF,TransformationFormat.PDF,JavaCast( &quot;null&quot;, 0 ),&quot;&quot;,JavaCast( &quot;null&quot;, 0 ));<br /><br />// Initialize FileOutputStream with fileOutput Variable<br />fileOutputStream = CreateObject(&quot;java&quot;,&quot;java.io.File&quot;).init(fileOutput);<br /><br />// Write The File...<br />outPDF.copyToFile(fileOutputStream);<br />&lt;/cfscript&gt; <br /><br />You can also download the source here <a href="http://blogs.adobe.com/livecycleblog/assets/transformPDF_EJB.txt" target="_blank">Download Source</a> </p>]]>
        
    </content>
</entry>
<entry>
    <title>Invoking Forms Service (renderPDFForm) via EJB </title>
    <link rel="alternate" type="text/html" href="http://blogs.adobe.com/livecycleblog/2008/08/invoking_forms_service_renderp.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://blogs.adobe.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=246/entry_id=6794" title="Invoking Forms Service (renderPDFForm) via EJB " />
    <id>tag:blogs.adobe.com,2008:/livecycleblog//246.6794</id>
    
    <published>2008-08-01T17:40:03Z</published>
    <updated>2008-08-01T17:58:06Z</updated>
    
    <summary>This sample provides the basics for invoking the renderPDFForm method of the LiveCycle FormsService. This sample assumes you are using LiveCycle on Jboss. If you are using a different Java server, you will need to modify a few paramaters, but...</summary>
    <author>
        <name>Allen Levine</name>
        
    </author>
            <category term="ColdFusion" />
            <category term="Forms Service" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.adobe.com/livecycleblog/">
        <![CDATA[<p>This sample provides the basics for invoking the renderPDFForm method of the LiveCycle FormsService. <br /><br />This sample assumes you are using LiveCycle on Jboss. If you are using a different Java server, you will need to modify a few paramaters, but the basics are the same. <br /><br /><strong>Environment Setup</strong> <br />1. Copy the following required jar files from your LiveCycle Installation to your {ColdFusion Install Directory}\wwwroot\WEB-INF\lib. <br />jbossall-client.jar [C:\Adobe\LiveCycle8\jboss\client] <br />adobe-utilities.jar [C:\Adobe\LiveCycle8\LiveCycle_ES_SDK\client-libs\jboss] <br />adobe-output-client [C:\Adobe\LiveCycle8\LiveCycle_ES_SDK\client-libs\common] <br />adobe-usermanager-client [C:\Adobe\LiveCycle8\LiveCycle_ES_SDK\client-libs\common] <br />adobe-livecycle-client [C:\Adobe\LiveCycle8\LiveCycle_ES_SDK\client-libs\common] <br />adobe-forms-client [C:\Adobe\LiveCycle8\LiveCycle_ES_SDK\client-libs\common] <br /><br />2. Restart ColdFusion Application Service <br /><br />renderForm_EJB.cfm <br />&lt;!--- <br />Modify these three variables to match your environment <br />** Be sure the fileInput is a PDF Form XDP <br />---&gt; <br /><br />&lt;cfset EJB_ENDPOINT = &quot;jnp://68.175.120.115:1099&quot;&gt; <br /><br />&lt;!--- Document Parameters ---&gt;<br />&lt;cfset inXDP = &quot;CAR.xdp&quot;&gt; &lt;!-- PDF Form File Name Source: Do Not Include Path Info ---&gt;<br />&lt;cfset inXML = &quot;C:\temp\CAR.xml&quot;&gt;<br />&lt;cfset outPDF = &quot;C:\temp\CAR1.pdf&quot;&gt; <br /><br />&lt;!--- URLSpec Parameters ---&gt;<br />&lt;cfset applicationWebRoot = ''&gt;<br />&lt;cfset targetURL = ''&gt;<br />&lt;cfset contentRootURI = 'C:\Adobe\forms\'&gt; &lt;!--- The Directory of the inXDP file located on the LiveCycle installed server ---&gt;<br />&lt;cfset baseURL = ''&gt; <br /><br />&lt;cfscript&gt; <br />// Create ServiceClientFactoryProperties <br />serviceClientFactoryProperties = CreateObject(&quot;java&quot;,&quot;com.adobe.idp.dsc.clientsdk.ServiceClientFactoryProperties&quot;);<br />connectionProps = CreateObject(&quot;java&quot;,&quot;java.util.Properties&quot;).init();<br />connectionProps.setProperty(serviceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, EJB_ENDPOINT);<br />connectionProps.setProperty(serviceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL, serviceClientFactoryProperties.DSC_EJB_PROTOCOL);<br />connectionProps.setProperty(serviceClientFactoryProperties.DSC_SERVER_TYPE, &quot;Jboss&quot;);<br />connectionProps.setProperty(serviceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, &quot;administrator&quot;);<br />connectionProps.setProperty(serviceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, &quot;password&quot;); <br /><br />// Initialize ServiceClientFactory with serviceClientFactoryProperties<br />myFactory = CreateObject(&quot;java&quot;,&quot;com.adobe.idp.dsc.clientsdk.ServiceClientFactory&quot;).createInstance(connectionProps); <br /><br />// Initialize OutputClient with ServiceClientFactory properties<br />formsClient = CreateObject(&quot;java&quot;,&quot;com.adobe.livecycle.formsservice.client.FormsServiceClient&quot;).init(myFactory); <br /><br />// Initialize FileInputStream with fileInput Variable<br />inXML_FileInputStream = CreateObject(&quot;java&quot;,&quot;java.io.FileInputStream&quot;).init(inXML); <br /><br />// Set inPDF Document <br />inXML = CreateObject(&quot;java&quot;,&quot;com.adobe.idp.Document&quot;).init(inXML_FileInputStream); <br /><br />PDFFormRenderSpec = CreateObject(&quot;java&quot;,&quot;com.adobe.livecycle.formsservice.client.PDFFormRenderSpec&quot;).init();<br />PDFVersion = CreateObject(&quot;java&quot;,&quot;com.adobe.livecycle.formsservice.client.PDFVersion&quot;);<br />PDFFormRenderSpec.setPDFVersion(PDFVersion.PDFVersion_1_5); <br /><br />// Create URLSpec Object<br />URLSpec = CreateObject(&quot;java&quot;,&quot;com.adobe.livecycle.formsservice.client.URLSpec&quot;).init();<br />URLSpec.setApplicationWebRoot(applicationWebRoot);<br />URLSpec.setContentRootURI(contentRootURI);<br />URLSpec.setTargetURL(targetURL);<br /><br />// Initiate The renderPDFForm Method<br />FormsResult = formsClient.renderPDFForm(inXDP,inXML,PDFFormRenderSpec,URLSpec,JavaCast( &quot;null&quot;, &quot;&quot; ));<br /><br />// Set outPDF Document For Result Handling<br />FormsResultPDF = FormsResult.getOutputContent();<br /><br />// Initialize FileOutputStream with fileOutput Variable<br />fileOutputStream = CreateObject(&quot;java&quot;,&quot;java.io.File&quot;).init(outPDF);<br /><br />FormsResultPDF.copyToFile(fileOutputStream);<br />&lt;/cfscript&gt; <br /><br />You can also download the source here <a href="http://blogs.adobe.com/livecycleblog/assets/renderForm_EJB.txt" target="_blank">Download Source</a> </p>]]>
        
    </content>
</entry>

</feed> 

