Pregunta

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

¿Fue útil?

Solución

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.

Otros consejos

Yes, you have to create an LC application using workbench. Here is how to do it:

  1. Create a new application in workbench using File -> New -> Application.
  2. Create a new Process using the right click menu at the application.
  3. Drop in renderPDF form activity from the activity and name it "renderPDFForm".
  4. Select renderPDF form activity to add variables using the bottom pane of variables.
  5. Add a variable of "Document" type and name it "inputXDP". We will use this to pass xdp file. Mark it to be "input" variable.
  6. Add a variable of "Document" type and name it "outPDF". Mark it to be "output" variable.
  7. Now double click renderPDFForm activity, this will open a property editor on the left side.
  8. Expand "Input" section if not expanded already. Make sure "Form" to be picked up from variable. Then choose "inputXDP" from the dropdown.
  9. Expand "Output" section if not expanded already. Make sure "Rendered Form" to be picked up from variable. Then choose "outPDF" variable from the dropdown.
  10. Now deploy your application by right click menu on application.

That is it. You are ready to go. Now save the process and double click "default start point" to get the rest url where this service would be exposed. The rest url should look like http://localhost:8080/rest/services/RestFormRender/renderForm:1.0. Here RestFormRender is name of the application and renderForm is name of the process. Now make a GET/POST call to this REST url and specify XDP bytes in "inputXDP" request parameter.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top