Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

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

FDFToolkit.net can also "Force a Download" of the merged PDF form.

Take Care,

Nick K.

www.nk-inc.com

Avatar

Level 1

Hi NKOWA,

     Does the FDFtoolkit.net has a trial version? Where I can download it?

Thanks and Regards

Avatar

Former Community Member

Please contact me at:

http://www.nk-inc.com/support/sales/

I do not want to post the registration and download urls online.

Regards,

Nick K.

www.nk-inc.com

Avatar

Former Community Member

FDFToolkit.net for ASP.net can parse, populate, merge PDF data formats such as, FDF, XDP, XFDF, and XML. Adobe Acrobat Standard or Pro is not required! With just Adobe Reader, your users can submit, download filled PDFs, or e-mail recipients without using Client Email software such as Outlook.

FDFToolkit.net works with Adobe LiveCycle and Adobe Acrobat Forms in pretty much the same way as FDFToolkit by Adobe, plus, it can merge and combine Adobe Acrobat & LiveCycle PDFs. FDFToolkit.net is a 100% Microsoft .net library, not a com object, so there is no server-side setup required, and it can work on just about any remote and local web servers, as well as standalone applications.

FDFToolkit.net programming can parse incoming FDF,XFDF,XDP, and XML files directly from a Adobe LiveCycle or Acrobat PDF form submission using ASP.net. Importing ADO.net datarow and datasets is easy with FDFToolkit.net. Import PDF data formats from a byte array, stream, string, or file.

FDFToolkit.net can also write FDF, XFDF, XDP, and XML based formats. Exporting data to ADO.net datasets and datarows is easy with FDFToolkit.net. Just name the PDF form field names the same as the ADO.net datacolumns, and populating the datarow is done with one function.  Export PDF data formats to a byte array, stream, string, or file.

FDFToolkit.net has many features not listed on this page.

For more information, please visit:

http://www.fdftoolkit.net/

For online tutorials and code examples, please visit:

http://www.nk-inc.com/blog/

Thank you for your time and I hope this information can help.

Also, be sure to check out:

http://www.pdfemail.net/

Kind Regards,

Nick K.

http://www.nk-inc.com/

Avatar

Former Community Member

Check out:

http://www.fdftoolkit.net/

FDFToolkit.net is a Microsoft .net library that can import, export, create, edit, read, write, populate and merge PDF forms data formats such as FDF, XDP, XML, XFDF.

FDFToolkit.net can take a PDF form submission and save the PDF form field values to a database using ASP.net.

FDFToolkit.net can also export datasets and datarows from a database, and populate or merge the data with an existing PDF form.

FDFToolkit.net works with Microsoft .net 1.1, and .net 2.0 and greater. Create, merge, populate, email, and save PDF form data using FDFToolkit.net and VB.net or C#.

FDFToolkit.net works with Adobe Acrobat forms and "Static" Adobe LiveCycle forms.

FDFToolkit.net includes 1 year of free technical support, and download updates.

FDFToolkit.net utilizes iTextSharp technologies, and works on local as well as remote Microsoft .net web servers, with virtually zero server-setup.

If you have any questions or need support, please contact me via our website:

http://www.nk-inc.com/support/sales/

For FDFToolkit.net programming tutorials:

http://www.nk-inc.com/blog/

For FDFToolkit.net examples:

http://www.nk-inc.com/software/fdftoolkit.net/examples/

I hope this information can get you started in the right direction.

Avatar

Level 1

Need some help

I have bunch of pdf forms which need to be integrted into the .NET environment. I see lot of great info about this. I understand that the new PDFs need to be designed through LC designer,

But what I need to do to enable the existing PDF documents to be XML compatable and be able to render and get data back from the application. I am hoping it is a simple exercise. Any help is appreciated.

Thanks

-Sundar

Avatar

Level 8

sure i will help you.

I think the first step is to convert the acrobat forms/pdf to xfa using LC designer.

Tarek

Avatar

Level 1

Thanks. How easy is it convert? sorry I am not familiar with LC Designer and I will try to get my hands on it. But from a effort perspective, I need to figure out how long will it take to do so for each form I have, so that I can estimate developers time.

Regards

Avatar

Level 8

After you learn using LC Desinger, it is very easy. Much easier than working with .NET Web Forms.

After you install LC Desinger, there is getting started in the help and also some tutorial to help you desing a form from scratch. Also, the installation ships with a lot of great samples that have everything you may need.

Each form may take from 1 to 5 days depending on the complexity and required functionality. No one can estimate without detailed requirements.

If your existing forms are based on AcroForms or Image based forms, then you can try to use LC Desinger Wizard to convert to XFA. I have tried this method several times, but it was a failure. I always start from scratch.

You can build Form/Script Fragments. They help you to save a lot of times by building reusable form parts. They are wonderful.

There are also Master Pages, very similar to ASP.NET. But, I did not find way to implement a reusable theme/style (CSS).

If you face any trouble using LC Desinger, post back and I'll try to help.

Tarek.

Avatar

Level 1

I have some design questions. I originally thought I can convert PDF into HTML forms and transfer the data into PDF once the data is entered into HTML. Though this may be cumbersome as I need to convert all PDF forms into HTML.  But based on my knowledge on LC, it is best to enter data directly into PDF forms by the end users through the .NET application.

Couple of questions

  1. Will the PDF form will fit in to the application as part of the application without opening a new window. I guess the answer is yes and should be simple to do. Wanted to confirm.
  2. How do we do the simple form validations and complex cross validations? I am assuming that we can write some javascripts and do simple validations. If this is so, does the form designer need to write these scripts or developer can embed them easily after the fact. Again I assume the second. Need confirmation
  3. For complex validation, can we have call out to server side services and show the error? With and without livecycle server
  4. For the end user to input data into forms, I am assuming that they don't need to buy any tool other than downloading latest Adobe reader

Thanks for any help. Also if there are sites that does this if somebody can send a link, that would help

Regards

Avatar

Level 8
  1. Will the PDF form will fit in to the application as part of the application without opening a new window. I guess the answer is yes and should be simple to do. Wanted to confirm.

    You can open PDF inside IFRAME or OBJECT tags. If you have Adobe Reader installed properly, you can opend PDF inside any Web Application. I think you can also open PDF Form in any Windows Application using ActiveX, but I don't have much info in this regards.
  2. How do we do the simple form validations and complex cross validations? I am assuming that we can write some javascripts and do simple validations. If this is so, does the form designer need to write these scripts or developer can embed them easily after the fact. Again I assume the second. Need confirmation

    PDF Forms are Stand-Alone Intellegent Forms, and also can work on-line and off-line. You can load all Validation Parameters at the time of creating the form and place the parameters as hidden Fields inside the forms. Also, you can call Web Services to retreive any data from any Web Service Provider. You have to use the built-in Validation Features of XFA which is either using JavaScript or FormCalc. You must use LC Desinger to embed the Validation Logic inside the PDF From. The logic you develop inside the PDF can do validation using any Form Field Data.
  3. For complex validation, can we have call out to server side services and show the error? With and without livecycle server

    You can call any Web Service from inside the PDF any time. Web Service can send Data to Server or Get Data from the Server, and also, you can send and recevie data using one Web Service Call. You can have as many Web Services as you want in a single PDF. To display the Error, you can use "Alert" JS function and several other methods, like display a custom message inside a subform, which can be hidden and then you can make it visible.
  4. For the end user to input data into forms, I am assuming that they don't need to buy any tool other than downloading latest Adobe reader

    I will give this info to the best of my knowledge. It may not be 100% accurate. Contact Adobe Sales for accurate details. You  must have at least the full version of Acrobat and then you have to Reader-Enable the PDF Form so that the end-user can use Adobe Reader to work with forms. Yet, there are some limitation in this case. To enable the full features of a PDF Form on the client who has Adobe Reader, you must get Adobe LC Reader Extensions Server which will allow you, the PDF Form Desinger, to Reader-Enable the PDF Form, so that any user who has Adobe Reader can work with PDF Form without any limitation.

I hope this answered your questions.

Tarek.

Avatar

Level 1

Yes. You did. Thanks for the quick turn around and being very helpful. Appreciate it.

I am also assuming that the approach of entering data directly into the PDF form is more efficient than creating HTML forms? this reduces one more form conversion life cycle and data transformation. Am I correct?

If XFA has all the validation scripts, would the end users be able to see (something like view source) from the forms they download? just curious

Regards

Avatar

Level 8

I am also assuming that the approach of entering data directly into the PDF form is more efficient than creating HTML forms? this reduces one more form conversion life cycle and data transformation. Am I correct?

If you want the end-result to be in PDF for a good reason, such as Data Entry is relatively huge with complex validation, and "protecting the data integrity and the author rights" then yes, It is much easier to use PDF. If the Data Entry is simple and you don't care about content authenticity, then maybe better use HTML and Web Forms.

If XFA has all the validation scripts, would the end users be able to see (something like view source) from the forms they download? just curious

If the end user has LC Desinger, then he can see the complete Desinge/Source Code of the PDF Form. But, you can secure PDF Desinge/Source Code using a password. Maybe there are other means to secure PDF Form Source Code, which I am not aware of.

Tarek.

Avatar

Level 1

Thanks. Your inputs are extremely valuable to me.

Regards

Avatar

Level 1

I have one more question.

How reusable are the scripts we put into the forms for validation or other help functions. Do we have to repeat on each form and change in everu form if the logic changes or we find a bug? or is it easy to do some kind of includes or other best practices to keep the code going out of control in the long run?

Thanks

Avatar

Level 8

How reusable are the scripts we put into the forms for validation or other help functions. Do we have to repeat on each form and change in everu form if the logic changes or we find a bug? or is it easy to do some kind of includes or other best practices to keep the code going out of control in the long run?

Simply develop your script in a Script Fragment. Check LC Designer help for more info. The Script Fragment can live inside a Subform or Script Object ...etc. You can reuse (insert/include) the script fragment into any other LC PDF Form, but you have to open the PDF From in LC Desinger, and the Fragment must be reachable from where opened the LC Form, and then must save the PDF Form.

If you change the Script Fragment, the PDF Form on the Client Side will not be affected.

Tarek.

Avatar

Former Community Member

Hi Terek,

Thank you so much for putting so much effort into this thread. I was looking at this for three hours and I did learn a lot.

I am brand new to either the pdf forms or Adobe LiveCycle, and recently my company replaced an old server for our website with a new one and suddenly all the forms couldn't be downloaded from the website and viewed anymore. I am wondering if there is anything I need to install on the new server or is there any thing I need to configer.

1. The pdf forms we use in the company are created in Adobe LiveCycle Designer.

2. We use Adobe Acrobat Pro to enable the extended features so that we can dynamically pull the data and filled into the form.

3. The forms we created can be downloaded by the user from our website. After they finish the form, they can submit either online or offline.

4. We are using Visual Studio 2010 and SQL Server 2008 for our website. The pre-filled fields of the pdf forms are retrieved from the database. After the user submit the form, the data will be stored in the database as well.

5. We use "application/vnd.adobe.xdp+xml" with iTextSharp.

The forms worked in the old server. I checked the old server and tried to see if there's anything installed, but I didn't find anything. I debugged our site in Visual Studio and seems like the data from database were successfully pulled out and passed through. However, when I tried to open the form from inside the web browser, I got a server error message saying " 404 - File or directory not found. The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable." And that means my pdf form was likely not created successfully. I checked my template folder(they need to be specified in the code in order to create a dynamic form), the template was there.

So now I really got confused of what I need to do. From your previous reply, I understand that I don't need to install anything other than Adobe LiveCycle Designer ES and Adobe Acrobat. So do you have any clue of what's the problem?

I really appreciate your help and hopefully it is not a complex issue.

Ray

Avatar

Level 8

Hi Ray,

Its realy my pleasure to help.

I think it is a security issue.

Allow Everyone user to access the empty template on the folder and check again.

Remember that the none ASP.NET resources like PDF are subject to special authentication which is different that ASP.NET resources like ASPX pages.

Try to access the PDF template directly from the IE Client, see what happenes.

Check the old server, and make sure that the IIS setup for the virtual directory or website is identical, specially the Security part. Also, make sure the ACL on the folders and files of the website are correct.

You need to consider the following:

- Are you using impersonation ? What is the user ?

- What is the authentication mode ? What was the active user at the time just before the error occured ?

- The user can be Anonymous (IUSER_machine-name), the Logged In User (on the client), ASPNET User, or Network Service.

- At any point in time, there are 2 seprate Authentication/Authorization taking place: Is access to .NET Resources allowed ? Is Access to none .NET resources allowed ? The situation can be very simple, and can be very complex. 

If you still cannot solve the problem, then please debug the project again (using attach to process on the new server, not using F5), post the sample source code used to display/download the PDF on the Browser, and tell me exactly what line is failling and what is the error message.

Tarek.

Avatar

Former Community Member

Dear Tarek,

I haven't locate where the problem is yesterday. I just wanna say thank you very much and Merry Christmas! I checked IIS settings but everything looks fine. I will work on the issue after my holidays. Thanks Tarek, you are a good man.

Ray

Avatar

Level 8

You are most welcome and mery christmas.

In your next post give me the following:

- Can you open PDF directly from IE by using absolute URL?

- Use the same URL of the PDF used in XDP and try to access the PDF.

- Is IIS version same on old and new server ?

- Can you reproduce the problem from all PCs (clients) ?

- Source code used and where the error is thrown and the error message.

Tarek.

Avatar

Former Community Member

Hi Terek,

I finally know what the problems are.

First, someone deleted the virtual directories on IIS. I know it sounds wired but they just gone! I might need talk to the Server Administrator.

Second, since the URL for the pdf files are dynamic according to the user's id and which team he/she belongs to. I mean, the team name is part of the URL and that somehow got modified. When I changed the team name(it is a folder inside the virtual directory) to what is in the URL, I can open my pdf form from client IE.

So the server itself have no problem and if I put the template file in the right directory, the pdf can be opened and the data can be binded successfully.

Thanks Terek, you gave me a lot of good ideas and I really appreciate those.

Sincerely,

Ray