[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.
Views
Replies
Total Likes
Hello Tarek,
I have read this link and it has a wealth of information.
I have designed a form using Livecycle designer ES2, this form will be launched from a WPF-C# desktop application.
This form needs to be prepopulated with data and data changes need to be saved back to teh database.
I am using an XML data source, the preview form comes up fine, but how do I get data into the form at run time. Currently it comes up blank.
Any help will be greatly appreciated.
Regards
Nanda
Views
Replies
Total Likes
Hi Nanda,
Sorry for late reply...
You can populate PDF Form (XFA) programatically uisng one of the following ways (to the best of my knowledge):
1. For Web Applications, you must compose the Data in XML Format, and it must be formatted correctly. To test if it is working, open a blank form, fill it with some data, and export the XML (using Forms/Manage Data/Export Data) to a file. Then open the file in IE for example and see how it looks. Note that, in .NET the XML Data can be composed using String Variable, and it must be formatted same way you see it when it was exported.
After you compose the Data in XML, you must compose the XDP which is: XDP Header XML + XML Data + XDP Footer (with URL to the blank form). It is simply a long string variable. Eventually, you must usine Respose Content Type to set it to be XDP Type, and write the XML String to the Response. This can be done even using PHP.
Usually, you must trigger the above logice from code-behined of ASPX page.
2. For Client Applications, you must use Acrobat SDK or IAC (Adobe Inter-application Communication or OLE Automation). In other words, you will have to write a program that uses the SDK to open Acrobat, then open the Form, then Import the XML Data to the form. So, the PC which has client application must have Acorbat installed or it will not work. If you try to use XDP to work on the client, I tried it before (2 years ago), and it did not work.
To make your job easier, you can develop a reusable program that will generate the XML Data (which can be used for Web and Client Applications), and then use it where needed, because XML Data Format it is the same regardless of where it is used.
3. Using LiveCycle ES Services. When you install Adobe LiveCycle ES Server, you will get a large number of Web Services or REST APIs which can be used from ASP.NET or VB.NET. So, there is one of the Forms Server Web Services, which simply take input the XML Data and the Path to the form, and then it will return the PDF. Also, you can use REST which is same like Web Service but much simpler. I have not doen this myself, but I worked on it when I was in Adobe LiveCycle @ MAX 2010 Training. It is very easy.
In all other cases, you will get a blank form .
I hope this helps.
Views
Replies
Total Likes
Hello Tarek.....
Please do not apologize for the lateness of the reply......Its great to receive replies at all
I read thru your reply and it is very detailed and clear. The issue is that I have a desktop application and opening a browser with the pdf form, is not an option.
I checked through the installation files of Livecycle and I cant find any DLL's that make sense. I have a Trial version of Livecycle
Please see this article http://www.avoka.com/blog/?p=318
Do I require Livecycle Workbench to get data? It does not offer a trial version
My company wants to make sure, all required features work before buying the Livecycle product
Awaiting your reply,
regards
Nanda
Views
Replies
Total Likes
Hi,
I understand from you that you need to provide the end user a feature where he can click a button from a C# Client Application, so after he clicks the button, it will open a PDF Form and it must be pre-populated with data based on some input parameters, is my understanding correct ?
By the way, I forgot to mention to you that you can create a WSDL Connection directly from PDF using LC Desinger. This is a great option, I have tested it and it is working like a charm (using SAP Web Service with very complex data strucutre and very large, and still working!). But, you need to develop the Web Service using say .NET. In my case, there was only one Input Parameter, which is the Logged In User ID (Windows User). I was able to capture this parameter from inside the Web Service. Also, you can bind the Web Service Input Parameters (WSDL Connection) to any Field on the Form. Same applies to the Results (output) of the Web Service.
You can Execute the WSDL Connection on certain events like Document Ready or Initialze Events of the PDF. Also, you can execute it on a click of a button. You will get same effect you are looking for (automatice pre-population of the form) if you use WSDL Connection.
BUT ... if you use a WSDL Connection, and if the PDF will open outside the browser, you will get some annoying prompts... you can ask however to trust the WSDL Connection URL, and you will not get such prompts.
I think you cannot avoid implementing parts of your solution using a Web Technology like a Web Service for example. Also, you will gain a lot if you accept to open the result PDF (populated version) inside the browser. If you use OLE/IAC (Acrobat SDK), it will be a pure Client Solution, and it can be done. But, I do not recommend this approach.
Note: I do have not practical experience working with LiveCycle ES2 Server. Some info I present about LC/Workbench my not be 100% accurate.
The most advanced and the best option is to depend on Adobe LiveCycle ES2 Services. I have only tested it when I was in LiveCycle @ MAX 2010 training, and I can't wait until I implement a solution using LC Services.
If you want to use Wrokbench, it is even better. This way, you can build a complete workflow application, but then it will have to be triggered from the Browser. Workbench is like VisualStudio, which will help you to desing the Workflow Process using GUI and Drag & Drop Controls. Some one at Adobe MAX told that Workbench is free, but I might be worng.
After you install Adobe LiveCycle ES2, you will not get DLLs, but you will get Web Services and REST APIs. You have to open the Admin UI, and then try to find the URL of the required Web Service. If you use Workbench, it will be a lot easier. Basically, you can create a new service using Workbench which will do exactly what you want, and finally make this service callable via SOAP or REST, then you can use it from your .NET Application. From .NET, all you have to do is to add a Web Reference to the Adobe LC Web Service, that is all. Adobe LiveCycle ES2 server has several modules (services). It will have something called Foundation Services. I think you will need something called Output and also Forms (or something like that).
The issue is really very complicated and it all depends on how far you want to go. Without having a clear and detailed requirements, and without doing a detailed analysis, it will be impossible to tell you what you need exactly. The Avoka blog post you provided is an excellent resource. I have added it to my bookmarks.
So, if your requirement is to provide a user with a button, and on click it will open the PDF and prepopulate it with data, then you can do this using:
1. Acrobat SDK. You will get a Pure Client Solution. Acrobat has DLL for .NET. Just add a reference to this DLL, and you will can do almost anything with PDF as if you are using Acrobat, but you can do it programatically.
2. Create a web page using ASP.NET (.aspx) which will generate the required PDF using XDP. Here, you don't need LC ES2 Server. From C# Client Application create an Browser Plugin (ActiveX or OCX) that will navigate to the ASPX page, and the user will not know that you are using a Browser. He will think you are using only C#. But if the user insists to know what is behined the C# application, in this case you have to say the truth . Download the Acrobat SDK and you will find examples using Browser Plugin inside a VB.NET Windows Application. I am 100% sure I found one in Acrobat 7.1 SDK.
3. Using LiveCycle ES2 Services. For complete tutorial check this: http://www.adobe.com/devnet/livecycle/articles/asp_net.html. But this is not a pure client application. You can use Workbech to desing a new Web Service to do exactly what you need, and also you can build a long-lived process with complex workflow rules. If you will need to use Workflow (Long-Lived Processes) you have to get Adobe LC ES2 Workspace (or something like that).
4. Using WSDL Connection. You need to develop the Web Services. This is really a nice option. If you connect to .NET Web Service, you will get the luxury of Integrated Windows Authentication.
I think you will need to have Acrobat on every machine, otherwise, you will have to buy Adobe LiveCycle ES Reader Extensions Server.
I hope this will be of help to you.
Tarek.
Views
Replies
Total Likes
Hello Tarek,
Thank you very much for your long and detailed reply.
This is the gist of the solutions that you have recommended -
1. ADobe SDK - you hv said not to use this, I had previously downloaded and tried this, but this is not compatible with LIvecycle and class instantiation throws exceptions. So I will pursue this only as a last resort
2. WSDL - I am reading up on this further
3. Workbench - I am downloading the trial version, I will investigate this and loop back with you
4. Web services / REST API / foundation Services- I am really clueless about how to use these. but I am trying to read up on documentation, hopefully after I install Workbench, I will understand further.
Again, thank you for taking so much interest and explaining so patiently. I will try all the options recommended and reply.
Best Regards
Nanda
Views
Replies
Total Likes
Hi Tarek,
I have a pdf file and on click of SUbmit ,I want to submit it to a webservice which has to save the entire PDF.I need to use Dot Net for teh webservice.Sample of the code will really help.
Thanks and Regards,
Leena
Views
Replies
Total Likes
Add a "HTTP Submit Button" control in the PDF form.
In the submit URL property of the button, set a URL like http://localhost/PDFManagement/PdfProcessor.aspx?SubmittedFormPart=1 and set the "submit as" property for the button as PDF.
In the PDFProcessor.aspx web form page load event handler, you can get the full PDF using the below code,
if (Request.QueryString["SubmittedFormPart"] != null && Request.QueryString["SubmittedFormPart"].ToString() == "1")
{
Stream fs = this.Page.Request.InputStream;
BinaryReader br = new BinaryReader(fs);
Byte[] bytes = br.ReadBytes((Int32)fs.Length);
}
Views
Replies
Total Likes
Thanks Anand,
But when i choose Http Submit Button", I do not get an option to Set the Submit As Property in Designer9.Am i missing something?
Regards,
Leena
Views
Replies
Total Likes
Add a Button object
like in the above screen shot.
Set the control type as submit.
You will see a submit tab.
In the submit tab, you will need to set the submit to URL property and submit as property.
This will work in livecycle designer
if your form is acrobat form, steps will be slightly different
Views
Replies
Total Likes
Thanks Anand,
I could achive the desired functionality.
Only one issue , after the PDF is saved it opens a blank PDF, is there some script with which we can have the same PDF in view?
Regards,
Leena
Views
Replies
Total Likes
Do you display the form online? Where do you store the PDF? in database or file system?
Views
Replies
Total Likes
There is a ASP page on which the form is opened ,then we click Save and the form gets saved in Document Repository(Using Sharepoint Portal).After clicking teh submit, a blank PDF with the title of that URL( asp url) is opening.
Regards,
Leena
Views
Replies
Total Likes
Hi Leena,
I just want to make sure I understnad your original question. You wanted to submit the PDF to a Web Service or a Web Page ?
A Web Service ASP.NET has ".asmx" file extension, and a Web Page has ".aspx" file extension.
See this Google Docs Folder. In case you are submitting to ".aspx" web page it will be of a greate help to you.
In case you want to submit to a Web Service ".asmx" then we have to work on this, as I have never done it before. As a matter of fact, I have to develop this fearture, since submitting to ASPX web page has some limitations like:
1. All changes made by the user before submit will be lost, if the server side validation has failed due to violation of business logic.
2. All changes made by the user before submit will be lost, if there is a technical probelm on the server.
First, we need to know if this is possible?
Tarek.
Views
Replies
Total Likes
Thanks Anand and Tarek..
I was able to achieve this.I had to have a ASP Page at the Server end instead of a webservice and submitted the Form as PDF to it which inturn saved the file to a specific server location.
Regards,
Leena
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies