Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

Using Adobe LiveCycle Designer with ASP.NET to populate PDF Forms from Server Database.

Avatar

Level 8

[Thread Edited By Adobe]

/*Don’t forget to meet and greet your fellow peers virtually by telling them about yourself here

Go ahead and to it now: https://adobe.ly/3eDnB4v */

 

Actual Question:

With Google, I did a very very long search on how to use Adobe LiveCycle Designer to design Interactive/Dynamic Forms, and publish them to the IIS Server and use ASP.NET to populate such forms with field values from back-end Database such as SQL Server.



We are designing and implementing Electronic Forms ASP.NET Application that must detect the user currently logged in to the Windows Intranet (under IIS), and should perform a Look-up to the Back-End Database to extract the User Related Data and Populate the Form Fields to start the Form Processing.



We have the following facts:

1. The forms will be designed using Adobe LiveCycle Designer 7.1.



2. We will NOT use Adobe LiveCycle Forms since it is not on our budget yet.



3. The users will have the required Adobe Acrobat version on the Client PC.



In a typical scenario, the user would go through these steps:



1. The user logs on to the Intranet using his Windows Login ID and Password. Then he starts the APS.NET Application for Forms Processing.



2. He will request a form to fill. The form may be populated with sensitive information such as Salary and only the requesting user must be able to see his Salary on any form.



3. On the server side, the system will use the User Windows ID to perform a query against the Back-End Database and generate the required XML Data.



4. The system must then link/merge the generated XML Data with the requested form and render (post) the form back to the user for further printing and/or submitting via email.



That's it !



I found an add-in product "Adobe LiveCycle® Designer add-in for Microsoft Visual Studio .NET" but it only wraps XPD forms in Visual Studio Component which is not of a great help to my requirements.



If any one could give me any hint on how to implement such requirements.



I truly appreciate any help.



Tarek.

275 Replies

Avatar

Former Community Member

mime should be:

  application/vnd.adobe.xfdf

Avatar

Level 8

Hi Anand,

Any reason why you are using Acrobat Forms and not XFA (LiveCycle PDF) ?

I can help you with XFA Forms, not much with Acrobat forms.

Tarek.

Avatar

Level 2

HI Tarek,

Could you please explain the differences between Acrobat and XFA forms? What is the benefit of going with XFA forms?

Also, let me know the licensing & software required to create and maintain XFA forms from ASP.NET web application.

I have static PDF forms, which i opened in Acrobat PRO 9 and converted to interactive forms. No special reason for going with Acrobat forms.

Regards,

anand

Avatar

Level 8

Hi Anand,

(Note: any information mentioned here is based on my own experience and investigation. If any one finds any error, please let me know)

XFA is the new technology for Forms from Adobe. It allows dynamic layout, and has better ways for connecting to external data sources. There are some advantages for Acrobat Forms, such as they are Static, and hence may render faster. But I am not the expert to tell the difference, this is just based on a research I have done long time ago.

Using XML to generate PDF and read data from PDF is wonderful. You can work with XML in any platform, since it is text based. Not to mention that you will find XML APIs in almost any platform, even in Javascript form inside the Browser on the client side. You do not have such advantage in Acrobat Forms.

For Web Enabled PDF Forms Processing, here is what you need:

Developer:

1. Adobe LiveCycle Designer ES,

2. Web Server like IIS 5,

3. Server Based Development Framework like ASP.NET,

4. Optional: Adobe Acorbat. This can be used to Reader-Enable the PDF. It will allow the client to do some additional things if he is using only Adobe Reader.

5. Optional: Adobe LiveCycle Reader Extensions Server (RES) to Reader-Enable the PDF. Same like 4 above, and the client will be able to do almost anything with the PDF as if he is using Acrobat.

Client:

1. Web Browser that has full support for XFA Forms. Google Chrome for example does not support XFA forms (as per my recent findings, if I did not miss anything).

2. Adobe Reader (appropriate version) installed properly. Sometimes you need to repair/reinstall to make it work. The version used must match that used in Adobe LiveCycle Designer.

If the PDF is not Reader-Enabled, the client will face a lot of limitation, like he cannot save the PDF nor he will be able to save the data.

3. Optional: Adobe Acrobat. With Acrobat installed on the client, he will not face any limitation. Keep in mind that things may not work as expected due to conflict in used version. This setup is very much sensitive to version compatibility. Always make sure the client has the proper version of Adobe Acrobat/Reader and that it is installed and working properly inside and outside the Browser.

What are the differences between Acrobat and RES for Reader-Enable the PDF? This is very difficult to answer (at least from my side). If you have Acrobat, give it a shot, and if you face any limitation, then we can assess the need to go for RES. Remember that RES is part of a full blown Enterprise Level Solution.

I hope this helps.

Tarek.

Avatar

Level 2

Thanks Tarek.

Let me try to create a Livecycle XFA form. It looks like there is no special component required on the web server and client (other than adobe reader) required to process XFA form.

Basically, I want to do the following,

1. Upload the PDF form and store as binary in the database

2. Retrieve the saved binary data and render as PDF in an iFrame in the browser

3. While rendering the PDF, fill some of the form fields automaticallly with data in the database

4. User can fill the remaining fields from the browser and click Submit button.

5. The save PDF should be saved as binary in the database.

6. User should also be able to download, print, reset the form.

I have done all these things with Acrobat forms and iTextSharp.

But, I want to remove the dependency on iTextSharp and create a custom code that does not depend on any third party libraries. Thats where the merging of XFDF and PDF came up.

Do you have sample to fill data in Livecycle PDF form?

Avatar

Level 8

I have started a while back to prepare a full guide on how to do just exactly what you have mentioned (1->6) with except storing the PDF in Database, since I don't advise you to do so, becuase the natural home for any file is the File System. But it is truely up to you.

Kindly check this link which has a shared folder on Google Docs:

https://docs.google.com/open?id=0B97clwYte2SHYWE1M2QyMzYtYTM0ZC00NTNlLWE0ZTMtMjAzNmRkNDYwODk3

I have not yet developed a complete guide. This has the code base for a DLL (Business Object CSLA .NET) which allows you to process a PDF form using resuable code. The code has not been updated since then (May-2011), and I can provide the updated version if you like. It will save you a lot of the time to code.

You can improve the Business Object to write the PDF Binary in a Database Table/Field. I think this is a good idea.

Let me know if you want me to develop the developer guide to use such busness objects.

Tarek.

Avatar

Level 2

Thanks Tarek. I have just downloaded the files from the link. I will go through it and get back to you.

Avatar

Level 8

I am putting some instructions in the User Guide. Check it after a while, and let me know if you have any quesiton.

The user guide is open for public editing. You can open the file, add comments, and do shared editing. I think you need to create a Google Account to get all features.

Tarek.

Avatar

Level 2

Just noticed that the PDF document contains a signature field, so, that shud also be supported...

Avatar

Level 8

There is nothing special I have done in the code that has to do with Digital Signatures. They are just supported if you install Adobe Reader/Acrobat and if you put a Singature Field using LiveCycle Desinger.

The only thing is that if the PDF Form is not Reader Enabled, you will not be able to sign the form using only Reader.

What I have done inside the PDF to track if signatures are signed, I simply change the value of a Status Field that indicates that the form "may" have been signed. Any way, I do not find any value for the process to keep a record on the server if the form is actaully signed or not. In my opinion, Digital Signatures are for the end-users. It is a kind of a security feature to assure who is the author of the document, confirm if the document was changed after it was signed, and finally, display the signed version.

To sign the form, the client (user) must "click" on the signature and he can create a Local Signature using Adobe Reader. I usually instruct the users to create a Local Signature integrated with Windows Certificate Store. This will avoid the need for the user to specify a password. All of our users are very happy using digital signature.

If you want to sign the form using code, then I cannot help you, because I have not done that before. If you know a way, please let us know.

Tarek.

Avatar

Level 2

Ok fine. actually, I'm planning to go with a third party component for digital signatures...

Thanks for all the details, Tarek.

Avatar

Level 2

Hi Tarek,

You have helped so many people and I was hoping you could help me with my requirement.

I am designing an ASP.NET page containing an embedded PDF form.  This PDF form will be displayed within this ASP.NET through a click of a LinkButton.  I am able to achieve this requirement so far.  One thing I am missing is to have the connectivity between this PDF form and my ASP.NET page to submit the user-filled PDF form to my web application's file directory (a folder within my website) as a PDF file using another LinkButton.  I know you have a similar requirement with sample codes posted in this thread.  Only thing is it is being submitted as 'XDP' which I know nothing about.

By the way, I am using LiveCycle Designer ES 8.2 to create my interactive PDF forms and my users will be using Acrobat Reader to fill out the form.  I hope you can lead me to the right direction.  Thank you.

Avatar

Level 2

Tarek, please disregard previous request.  A resolution has been reached.  Thank you for your time.

Avatar

Level 1

Hello can you send me

a working copy of a PDF with asp or PDF

that will take the users Name and when the user Clicks the SAVE AS button the pdf file will go to a folder on the server with the users name form the PDF file so we know what file each user saves. You can email me at fredssmith@mail.com 

Help needed please

Avatar

Level 8

fredssmith,

What you are asking for can be done, but is a client side type of solution.

I mean, each user who wants to use your form, must do some configuration work to so that he can use the form functions.

So, if the number of the users is small, that is fine. Otherwise, it will be hell of a job. Not to mention the maintenance overhead.



Why not implement a server-side solution ? It will take a bit more time to get started, but this is the right direction.

Could you please specify your requirements, I need more details to be able to help you. Do not mention how to impelement the solution, just talk about your requirements.

Tarek.

Avatar

Level 8

This is a reply to the original thread posted here:

http://forums.adobe.com/thread/564995?tstart=0

I will come back with an answer soon.

Tarek.

Avatar

Level 8

Hi AjoJoseph,

Looks like your application does not need to be web-enabled, right ?

In that case, you will have to develop some kind of client-side application using VB.NET. There is no need to develop web-application using ASP.NET since this will add some confusion to the user, but in my opinion, it will be easier to develop web application than a client-side application. Keep in mind that you need at least one license from Adobe Acrobat if you go for client-side application.

However, if you decide to make it client-side, then check this thread:

http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=15695

I never used iTextSharp. I used Acrobat SDK, XDP (xfa) and XML to handle data communication from/to the Database and the PDF Form.

I tried to work with iTextSharp about 2 years ago, and I got lost, so I decided to use the available tools from Adobe and .NET to achieve my requirements.

The workflow you suggested is correct. If you do not want to do fancy job (on-line submission), then this is the way to go. We implemented similar workflow process last year to deal with about 200 PDF Forms, and it worked 100% correct.

I will add the following to make it work properly from the technical side:

1. Write a .NET Program using Acrobat IAC (OLE) to generate and populate the PDF. First, Generate the XML Data, use Empty PDF as a template, then attach the XML Data to the PDF, then save the PDF using a Key Value as the File Name. You can use .NET XML Object to generate the XML String. Make sure to assign the Key Value to a field inside the PDF as Read-Only. Also, put some control fields inside the PDF like: Status, DateTime Stamp, PDf Version ...etc to help you make correct decisions while processing the PDF.

2. Decide if you want to send the generated PDF also from a .NET Program. It can be done.

3. Once you receive the PDF as a reply by email, save them all to a folder in the local drive (we have done this manually).

4. Write a .NET Program to iterate over the saved PDF Files, extract the XML Data, and write the result back to a Database, if needed. You can then here send confirmation by email to the applicant.

I hope this will be of help to you.

Tarek.

Avatar

Level 1

Hi Tarek,

Thank you very much for the reply.

I have one  doubt. You mentioned "need at least one license from Adobe Acrobat if you go for client-side application", that means we have to buy licence in each client mechine in which we install the application or only in my developemt mechine ?  If I install free Adobe Acrobat reader in end user mechine, this will work or not. I can include Adobe dll in my setup if required. Bcz I can't tell all end users  to buy Adobe license.

Thanks & Regards

Ajo Joseph

Avatar

Level 8

Hi Ajo Joseph,

You only need Acrobat Pro License on the PC where you will run the program that uses Acrobat SDK/IAC/OLE. If you enable Reader Rights, to the best of my knowldge, it will be maintained and the end-user do not neet to have Acrobat License. You need Acrobat in any case to Enable Reader Rights from the source.

Tarek.

Avatar

Level 1

Hi Tarek,

Thank you very much for the information.

In my case, reading data from a filled form and updating data back to database is not that much important. I need to dynamically fill the form using the data from my database before I email the forms to end users. For this purpose can you give any sample code/Docuementation ? I am going through VBJavaScript.Pdf. I am planning to continue with VB.Net, not ASP/WEB, bcz I am familiar with VB.NET and C#.NET.

Thanks & Regards

Ajo Joseph

Avatar

Level 8

Just go through the sample code you I gave you. What you are asking for is just the reverse operation. As a matter of fact, the sample code I provided is generating a Unique Serial Number and saving the result in "Form_Id" field, then it will save the form back. It has everything you need to get started.

Tarek.