Search code examples
pdfadobelivecyclexdp-pdf

How to convert XDP to PDF in Adobe LiveCycle ES3 via HTTP REST request


I have: LiveCycle server (ES3, JBOSS), Workbench, Designer. Using LC Desginer I convert PDF to XDP - it's template now. Now I need to convert that XDP file to PDF. So, I guess I should somehow call LiveCycle server by HTTP request, in body of this request I can send body of XDP document. All what I need from LC is just PDF.

Looks like simple task, but I can't find ANY information how to do this. I see a lot of examples how to do this in Java, but I don't need Java, I need to do it via HTTP (REST endpoint or SOAP if it's not possible).

Maybe I need to create some "application" in Workbench? If so, is there any step-by-step documentation? Or maybe somebody can explain me, how to do this. Maybe there is already build-in application in ES3 Server - I think it's very common and simple case.

UPD: I've opened job at Odesk for this issue, I promise to post solution here to share knowledge with community


Solution

  • As was promised, here is how to solve this issue:

    1. It's not enough just put PDF into LiveCycle Designer. You exactly need to design form in LC Designer. You can use your PDF as template, but for all things which you want to fulfil by your custom data, you need to add objects in LC Designer (take a look at the "Insert" menu, try Table or Text Field) and add Data Connection in the "Data View" tab. I think it's pretty easy step for professionals, but it can take some time to get by beginners. Save results of your work as, for instance, Template.xdp file.
    2. Also you now have the example of XML file - source of the data. Let's name it DataSource.xml
    3. Now we can install LiveCycle Server. Best for LC ES3 is RHEL 5.5 (we spent around 2 days just to find correct combination of OS and settings). You'll need a clever system-administrator (or just experienced in Adobe LiveCycle :))
    4. Server is working now, you can see web-interface, so let's create application in Adobe LiveCycle Workbench ES3. Add an application with new name and add a process to that application. It will take to many words to describe all steps of process, just take a look at screenshots of result (and notice variables also): step 1 step 2 step 3

    5. Now most easy part - call this app by the HTTP request. But we can't just send usual POST request to Adobe LiveCycle :) We have to send content of 2 files (Template.xdp and DataSource.xml) as multipart/form-data and names of the parts are the names of input variables (in my example is xmlTemplate and xmlData). And don't forget Authorization header with Basic authorization credentials.

    6. In the Response you'll receive base64-encoded body of the PDF document.

    Thanks to Thierry Stortenbeker for this application and for help and patience.