Skip navigation
Currently Being Moderated

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

Mar 22, 2012 5:22 AM

Tags: #pdf #data #forms #xml #electronic

Hello,

 

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,

Ionel

 
Replies
  • Currently Being Moderated
    Mar 22, 2012 6:18 AM   in reply to djionel82

    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:

     

    http://www.halnesbitt.com/pages/pdfqs.php

     

     

    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:

     

    http://www.windjack.com/WindJack/Browser2PDF/brwsr2acroJS.htm

     

    I hope this will be of help to you.

     

    Tarek.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 22, 2012 8:00 AM   in reply to djionel82

    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-and-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.

     

    Tarek.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 22, 2012 8:17 AM   in reply to djionel82

    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:

     

    http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/iac_deve loper_guide.pdf

     

    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)

     

    Tarek.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 27, 2012 1:17 AM   in reply to djionel82

    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.

     

    Tarek.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points