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

For me: LiveCycle server (ES3, JBOSS), Workbench, Designer. Using LC Desginer, I convert PDF to XDP - this is the template now. Now I need to convert this XDP file to PDF. So, I think, I need to somehow call the LiveCycle server using the HTTP request, in the body of this request I can send the body of the XDP document. All I need from LC is just a PDF.

Looks like a simple task, but I can’t find ANY information on how to do this. I see many examples of how to do this in Java, but I do not need Java, I need to do this via HTTP (REST or SOAP endpoint, if this is not possible).

Perhaps I need to create some kind of “application” in Workbench? If so, is there step-by-step documentation? Or maybe someone can explain to me how to do this. Perhaps ES3 Server already has a built-in application - I think this is a very common and simple case.

UPD: I am opening work in Odesk for this problem, I promise to publish a solution here to share knowledge with the community

+4
source share
2 answers

As promised, here is how to solve this problem:

  • It’s not enough to just put the PDF in LiveCycle Designer. You definitely need to create a form in LC Designer. You can use your PDF as a template, but for all the things you want to do with your user data, you need to add objects to LC Designer (see the "Insert" menu, try a table or text box) and add a Data Connection in the " View data. " I think this is a fairly simple step for professionals, but it may take some time for beginners. Save the results of your work, for example, Template.xdp .
  • Also, you now have an example of an XML file - a data source. Name it DataSource.xml
  • Now we can install LiveCycle Server. The best for LC ES3 is RHEL 5.5 (we spent about 2 days to find the right combination of OS and settings). You will need a smart system administrator (or just experienced in Adobe LiveCycle :))
  • Now the server is working, you can see the web interface, so let's create an application in Adobe LiveCycle Workbench ES3. Add an application with a new name and add a process to this application. Many words to describe all stages of the process, just take a look at the screenshots of the result (and pay attention to the variables): step 1step 2step 3

  • Now the easiest part is to call this application using an HTTP request. But we can’t just send a regular POST request to Adobe LiveCycle :) We must send the content from 2 files ( Template.xdp and DataSource.xml ) as multipart / form-data, and the part names are the names of the input variables (in my xmlTemplate and xmlData ). And do not forget the authorization header with basic authorization credentials.

  • In response, you will receive a base64-encoded PDF document.

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

+2
source

Yes, you need to create an LC application using the toolkit. Here's how to do it:

  • Create a new application in Workbench using File -> New -> Application.
  • Create a new process using the right-click menu in the application.
  • Drop the renderPDF form visualization from the action and name it "renderPDFForm".
  • Select the renderPDF form operation to add variables using the bottom panel of variables.
  • Add a variable of type "Document" and name it "inputXDP". We will use this to transfer the xdp file. Note that this is an “input” variable.
  • Add a variable of type "Document" and name it "outPDF". Note that this is an “output” variable.
  • Now double-click the renderPDFForm operation, this will open the property editor on the left side.
  • Expand the Enter section if it is not already expanded. Make sure the "Form" is selected from the variable. Then select "inputXDP" from the drop-down menu.
  • Expand the Exit section if it is not already expanded. Make sure that the "rendered form" is selected from the variable. Then select "outPDF" from the drop-down list.
  • Now deploy the application by right-clicking on the application.

That's all. You are ready to go. Now save the process and double-click the "default start point" to get the remaining URL where this service will be displayed. The rest of the link should look like http://localhost:8080/rest/services/RestFormRender/renderForm:1.0 . Here, RestFormRender is the name of the application, and renderForm is the name of the process. Now make a GET / POST call to this REST URL and specify the XDP bytes in the "inputXDP" request parameter.

+1
source

Source: https://habr.com/ru/post/1469540/


All Articles