8 Replies Latest reply on Mar 28, 2012 1:27 AM by djionel82

    read/write xml data from/to adobe livecycle forms (pdf)




      I need some help reading xml data from pdfs created by Adobe LiveCycle and also writing xml data back to the form.


      The forms have been created using PROD LC 8.2 and in the future they will be created using PROD LC 9.5.

      I am using Visual Basic .NET to access the data programatically.


      Can anyone help me with some hints? A library, SDK? Any information would be very helpful.

      I am quite new with this Electronic Forms issue and I do not even know where to start.


      Thank you,


        • 1. Re: read/write xml data from/to adobe livecycle forms (pdf)
          tarekahf Level 2

          Hi lonel,


          Do you want an online solution?


          I mean, it follows this workflow:


          1. The user will open the PDF by clicking a link, and a server-side program will generate the PDF and prepopulate it with data from some data sources, and render the PDF to the client (Browser),


          2. The user will fill the PDF.


          3. The user will click a Submit button and save the PDF and Data on the server.


          4. If the user wants to edit the Submitted Form, he will click a link to open the save PDF and possibly prepopulate some fields with data from other data sources, and complete the cycle of filling and saved the PDF and Data on the server.


          5. While the user is filling the PDF (inside a Browser), there might be a need to perform some lookup on the server, and update the form parts accordingly as a result of the lookup process.


          For 1-4 above, I have developed a complete base library using ASP.NET which helps you to perform the above.


          You can goto my Google Workspace and you will find a bunch of documents, sample PDFs, collections and VB Classes. To best view them, login using some Google Account.


          For point 4 above, one way to perform this effect, is to regenerate the required XML Data (which has the saved data before and the new lookup data), remerge the entire XML result with and empty PDF Form, and render the XFA (PDF Form) back to the client. But, if the PDF has one or more signatures, it will not work. So, in this case, you can update the Form Fields of a Saved PDF Form with new Data from the server, but the net effect is that you will have to loose all the signatures that were added on the PDF before.


          For 5 (above) there are 3 methods:


          1. Using a Web Service as a Data Connection. This is very easy if you have a traditional Web Service. I have used this method several times and will use it again if the need be. But, there is a problem. If the result of the Web Service is an Array of some Data, and you want to remerge the XFA to get the required effect after executing the web service ... and ... if there are some Drop-Down-List (DDL) fields, the bindings of the DDL Items of those fields will be lost. But, you can rebuild them (on enter event of the DDL Field)  if you have saved them in the embedded XML Data.


          2. You can update few (not many) fields while the PDF is opened (under the Browser via IFRAME) by passing the new field values using the URL Query String method. I have not done this, but I like this method, and I think it is cool. You need to write a server side code to ensure the the new filed values are passed back to the client using the correct URL with the Query String, and you need to write some javascript code inside the PDF to parse the URL and get the new field values and update them accordingly. See this as an example:





          3. This method is very advanced and uses message communication ques between the Browser and the PDF (which is opened inside IFRAME element) using HostContainer object. This method will enable 2-way communication between the Browser and the PDF on the client side using javascript. I'd love to use this method one day. See example here:




          I hope this will be of help to you.



          • 2. Re: read/write xml data from/to adobe livecycle forms (pdf)
            djionel82 Level 1

            Thanks for the reply, Tarek!


            Actually I am looking for a desktop application, not a web one.

            I have the pdfs already generated and filled in with user data. The pdf template is common for all the forms.


            So what I would like to do is to create a desktop application that will extract the xml data from the forms and store it in an underlying sql database.

            From the desktop application, one should be able to view the electronic form, by using the pdf template and loading it on the fly with the xml data already stored in the data base.


            Would this be possible?

            • 3. Re: read/write xml data from/to adobe livecycle forms (pdf)
              tarekahf Level 2

              Ok, I now understand what you mean. I have done similar thing about 4 years ago.


              See this thread:


              http://acrobatusers.com/forum/forms-livecycle-designer/how-extract-lc-form-fields-values-a nd-store-them-database/


              and also this thread:


              http://forums.adobe.com/message/1157969  (read until the end. This is mostly trial and error until I found the solution, which is documented above. It will give more info.)



              It has most of the reuqirements you are looking for. If this is close to what you are looking for, then I can upload the complete source code to my Google Workspace. Plesae let me know.


              I hope it will be of help to you.



              • 4. Re: read/write xml data from/to adobe livecycle forms (pdf)
                djionel82 Level 1

                Thanks, Tarek!

                This looks like the solution I have been looking for. I will give it a try. I hope not too much has changed, since it's 4 years old.


                Do you know if a license is required for using this solution in a comercial software?



                • 5. Re: read/write xml data from/to adobe livecycle forms (pdf)
                  tarekahf Level 2

                  Yes, each client PC using this method must have Adobe Acorbat Prof. license. And you should not use this method under ASP.NET and IIS.


                  For more technical info, see this IAC guide:




                  My advice, try to stay away from such implementation. It is client based, and not much information available. Also, I have a feeling that it may change over time.


                  Better to design your solution to be web based. While what you are asking for seem to be more reasonable to be implement using Desktop Application, but it will result into a lot of headach.


                  I think in your solution, you will ask the users to fill the PDF off-line. Then, they will send the filled forms via email eattachments or similar method. Then, you will compile the filled form in a Folder, to process them.


                  There is another method also which is using Adobe LiveCycle ES Server - Output or Foundation (I cannot remember). When you install the server, it will give you traditional Web Services which will allow you to do exactly the same as mentioned here, and much more. It has watched folder support, but I never worked with it before. This is Enterprise Level Solution.


                  This video will give you more details:


                  http://youtu.be/04tpN44b8OM (part 1)


                  http://youtu.be/nOc7uXSjJnU (part 2)



                  • 6. Re: read/write xml data from/to adobe livecycle forms (pdf)
                    djionel82 Level 1

                    Hello again,


                    I have done some reading and started to try out the examples in the Acrobat SDK.

                    I found an example that loads a pdf inside the .NET application.

                    But when I tried to load an electronic form, the pdf content has been replaced tith the following message:

                    "The form has been opened inside a web browser window. Please download the form to your PC in order to be able to properly save the form after filling it in."


                    How could I fix this problem?


                    Ah, and Tarek, since you mentioned it, it would be great if you could provide me with the complete source code of your solution.





                    Message was edited by: djionel82 (added a screenshot of the message)

                    • 7. Re: read/write xml data from/to adobe livecycle forms (pdf)
                      tarekahf Level 2

                      Hi lonel,


                      Regarding the error you reported, I never faced this before. Try the following:


                      1. Reader-enable the form using Acrobat.


                      2. Make sure Acorbat Prof. 9.3 is installed properly.


                      3. Remove all installed versions of Reader/Acrobat, and install one clean version.


                      4. Remove Google Chrome, and install IE 8, and make sure you can open the PDF inside IE.


                      5. Try to do the same what you are doing using a Static PDF Form (Acrobat Form).


                      6. Try to do the same using a PDF Document created from MS Office.


                      Now you can check my Google Workspace again, and you will find the VB.NET project under VS 2005 with some documentation.



                      • 8. Re: read/write xml data from/to adobe livecycle forms (pdf)
                        djionel82 Level 1

                        I found the problem.

                        It seems that the electronic forms that I am using have been created with this restriction in mind, so that they cannot be opened in the browser.


                        Is there any other way to display an electronic form in a .NET desktop application, except for using the Browser control?