Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

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
load submited data from form:<br /><br /> For a = 0 To Request.Form.Count - 1 <br /> If InStr(Request.Form.Keys(a), "Hamta") > 0 Then Hamta = True<br /> If InStr(Request.Form.Keys(a), "Spara") > 0 Then Spara = True<br /> If InStr(Request.Form.Keys(a), "TaBort") > 0 Then TaBort = True<br /><br /> Temp = Request.Form.GetKey(a)<br /> Do While InStr(Temp, ".") > 0<br /> Temp = Mid(Temp, InStr(Temp, ".") + 1)<br /> Loop<br /> Temp = Left(Temp, InStr(Temp, "[") - 1)<br /> If UCase(Temp) = "ARENDENUMMER" Then Ärendenummer = Request.Form(Request.Form.Keys(a)) ' hämta formulärets loginid har hittat loginid<br /> If UCase(Temp) = "NAMN" Then Namn = Request.Form(Request.Form.Keys(a))<br /> If UCase(Temp) = "TEXT" Then Text = Request.Form(Request.Form.Keys(a))<br /> Next<br /><br />Populate the pdf form.<br /><br /> If Hamta = True And RecordAnt > 0 Then<br /> Response.ContentType = "application/vnd.adobe.xdp+xml"<br /> Response.Write("<?xml version=""1.0"" encoding=""UTF-8""?>")<br /> Response.Write("<?xfa generator=""XFA2_0"" APIVersion=""2.2.5028.0""?>")<br /> Response.Write("<xdp:xdp xmlns:xdp=""http://ns.adobe.com/xdp/"">")<br /> Response.Write("<xfa:datasets xmlns:xfa=""http://www.xfa.org/schema/xfa-data/1.0/"">")<br /> Response.Write("<xfa:data>")<br /> Response.Write("<form1>")<br /> Response.Write("<Namn>" & Rs.Fields("Namn").Value() & "</Namn><Text>" & Rs.Fields("Text").Value() & "</Text><Arendenummer>" & Rs.Fields("Arende").Value() & "</Arendenummer>")<br /> Response.Write("</form1>")<br /> Response.Write("</xfa:data>")<br /> Response.Write("</xfa:datasets>")<br /> Response.Write("<pdf href=""http://www.dtp-tjanst.com/Acrobat/PreLoad/PreLoad3.pdf"" xmlns=""http://ns.adobe.com/xdp/pdf/"" />")<br /> Response.Write("</xdp:xdp>")<br /> Response.Flush()<br /> Response.End()<br /> End If<br /><br />I hope that can give some ideas<br />ulf.a@dtp-tjanst.se

Avatar

Level 1

Would anyone happen to know why some data may not be available in the meta data of the pdf file?  I am unable to find the images I have created in LS Designer.  I am also unable to find some upsidedown text fields.

Any help is much appreciated.

Avatar

Level 8
Dear Ulf I Andersson ,



Thank you so much ... I got the idea ... but, what is the Language used on the PreLoad3.PDF form ? This is the only difficulty I faced, as I could not understand the purpose of the form. However, I could use the same logic for my requirements.



Just tell me one thing, How I can submit the PDF from the Client Web Browser to the IIS Server ASP.NET Web Page so that I could retrieve the Field Values using "Request.Form" ?



Is it possible to submit the form to it self on the server side and do the same thing to manipulate the form? Is this a good way to do such a thing ? Usually, in ASP.NET the forms do not submit to a different Page, they submit to them selves ? Did you notice that ?

Avatar

Former Community Member

Hi Tarekahf,

I am trying to automate the PDF submission process for the organization.

I have an iframe in which I am displaying the fillable pdf. The PDF is created using the live cycle designer.

On the  PDF I have a Submit button. In the submit to URL I have the path to my asp.net server page and on the "submit as" dropdown I have "PDF" selected.

When I run the application and click on the submit button nothing happens (I am not able to hit the break point on the page load of server page).

Submit button works when I select the option of XDP or XML. I have tried to save the PDF as both static PDF and dynamic xml form but nothing seems to work.

I would appreciate a lot if you could help.

Thanks

Avatar

Level 3

Please ensure that your PDF is reader extended

Regards,

Leena

Avatar

Former Community Member

Hey Leena

Thanks for the reply but how am I supposed to make the PDF reader extensible? Can I do this from live cycle designer es2 version 9.0.X.X  or do I have to use Acrobat Pro X.

I tried the Acrobat Pro X but I was not able to find the 'Advanced' menu option. I am using trial versions for both live cycle and acrobat pro.

Thanks,

Junaid

Avatar

Level 8

Hi Junaid,

You can reader-enable the PDF using:

1. Adobe  LiveCycle Reader Extensions Server (LCRES)

or

2. Acrobat. Each version may have different way to reader-enable. But to submit from the Browser, you need LCRES. Acrobat can "reader-enable" but provides limited functionality.

See my Google Docs Workspace to see a screen shot of LRES.

Tarek.

Avatar

Level 3

Hi Tarek,

The asp page is now on HTTPS.When I am trying to submit the form as PDF,it is being recieved as 0 bytes.The same is working with HTTP.

Any idea?

Thanks,

Leena

Avatar

Level 8

Hi Leena,

I never faced this situation before. I will do some search. But, most likely, it is related to client/server are setup properly to support HTTPS. Most likely you need to change Web.config to enable support for HTTPS.

Check this:

http://stackoverflow.com/questions/539732/how-to-use-https-in-an-asp-net-application

Tarek.

Avatar

Former Community Member

Hi,

I have a standalone PDF from which I need to call a web service to autopopulate the pdf. The PDF should work in Adobe Reader.

The call to the webservice works in Adobe Acrobat.

I have downloaded a trial version of ADEP to use the reader extensions but not sure how.

I have looked at the screenshot 

https://docs.google.com/file/d/0B97clwYte2SHYjQ0OWMzNjQtMmE3Mi00MzE5LTkzMWMtZjM5Nzc5ZTkwYTUy/edit?pl...

and have a few questions.

1) Is the screenshot from livecycle? If yes then how to navigate to this screen. I have Livecycle version 8.2 on my machine.

2) If I have to do this from reader extensions server component (LCRES) then can you send me the navigation steps. Again I have installed the adobe digital enterprise platform trial version using the jar file.

Thanks,

Junaid

Avatar

Level 8

Hi Junaid,

Installing Adobe LiveCycle ES Server, for me, it was one of the most diffcult processes I have ever faced.

I cannot remember exactly how I have done it last year, but check the following:

1. Did you read the installation guide? Make sure to read the relevant parts of any documentation you get from the download link.

2. Did you follow the trun-key installation? This means automated one.

3. Depending on the option you chose for installation, you should see services services running such as: "JBoss for Adobe LiveCycle ES2" and "MySQL for Adobe LiveCycle ES2". Do you see such services, and are they started?

4. To navigate to Reader Extensions Server (RES), you need to make sure the cleint (browser) has the latest version of Flash and a decent browser such as IE8, then goto this address from any client:

http://<ServerName>:8080/ReaderExtensions  (user:administrator/pwd:password  by default)

where 8080 is the default port, if you did not change it. If this port is already used, then you have to change it, but I don't know how.

The first time, it will take a while to open... just be patient!

5. To be able to use RES, you must install a Certificate using the LC Server Admin UI. This is also another story. I forgot how to do that actually. Part of the install process, there is option to download and install a certificate which will be valid for 2 weeks I think. This means, after you Reader-Enable the PDF, it will be valid for 2 weeks (as per what I remember).

The latest version is Adobe LiveCycle ES3 Server (I think), and make sure you are not confusing this with the LiveCycle ES Desinger, which is a client product.

Tarek.

Avatar

Level 1

Hi Tarek,

Need suggestion on the question i asked u in my previous post.

Could you please advice based on my requirement, since i am generating PDF , XML and my PDF templates all residing at my App Server Layer, what kind of Adobe product is required at server side.

Kindly note that i need the reader extension feature at Client Side.

Any advice on using:

  • Acrobat SDK  or
  • PDF Library SDK or
  • Acrobat PDF Library. or
  • Or any third party software like : ASPOSE, ACTIVEPDF etc

Avatar

Former Community Member

Hi,

I have tried to install whatever I could from this URL http://www.adobe.com/devnet/livecycle/trial.html

After downloading I got a folder named LiveCycleWorkbench_9500_WWE_Win, LiveCycleServer_9001_JBoss_WWEFDJ_Win, LCRE_ES_Certificate_Trial,

LC_9.0.0.2_QF_2.38.

Initially I clicked on the run_windows_installer.bat in the LiveCycleWorkbench_9500_WWE_Win folder which installed the livecycle workbench successfully, after this I am not able to install the run_windows_installer.bat in the  LiveCycleServer_9001_JBoss_WWEFDJ_Win folder. When the .bat file is clicked nothing happens.

I am trying to enable PDF for reader extensions(server) to call a web service from adobe reader.

Can someone write the step to installing the reader extensions server component. What are the prerequistics etc.

Tarek after starting the workbench I have checked the services services.msc but didnt find any for jBoss or mySQL.

Thanks,

Junaid

Avatar

Level 8

Hi Junaid,

You are installing Workbench, which is not Adobe LiveCycle Server. Workbench is like Visual Studio for .NET.

Try this link, it has full documentation, and this is the one I used when I installed it last year:

http://help.adobe.com/en_US/livecycle/9.0/documentation.html#task=1,3&module=-1

Keep in mind that this is like installing MS SharePoint Server. You have to do a lot of steps.

For reader extensions, you also have to download a trial certificate which also you have to install using LC Admin UI or something like that, and then you will be able to reader-enable the PDF Files.

May I ask you to take screen shots while you are installing. This way, you will make it easier for other.

I feel sorry I did not take screen shots with every step.

Next time, I will surely take screen shots, or I will record a video using Screenr.com.

Tarek.

Avatar

Level 1

Hi Tarek,

I have a new requirement where in it is:

  • We have Two PDF template T1 and T2 both are reader extension enabled ADOBE LS Dynamic forms.
  • As per business need, customer wants the final PDF should have data comprising of Template T1 and T2 and also reader extension enabled.

Please advice is this possible if yes what approach should i take?

Thanks

Robin

Avatar

Level 8

Hi Robin,

I think that is easy to do, if you follow my recommendation for implemeting your requirements from the beginning.

Here is the process/flow you have to follow:

1. User U1 clicks a link, and T1 is generated, and probably prepopulated if required, and rendered back to user.

2. User U1, after T1 is rendered, he will fill the PDF Form and click Submit.

3. The Submit process (ASP.NET Program) by U1 for T1 will extract the PDF Binary (T1-key.PDF) and Data (T1-key.XML) and store them on separate files on a folder on the server. Make sure to generate the files names so that they have the primary key or a unique key. Also, during the submit process, it is better to insert a control record in a SQL Server Table, which has the primary key, and the file name (PDF and Data) and location. I can give you a sample of a Table I am using if you like.

4. Now, some time later, User U2 will click a link to generate T2 and probably prepopulate if required, and it will be rendered back to user.

5. Same like 2 above, but for T2.

6. Same like 3 above, but for T2.

7. By now, you have 4 files:

 

  * T1-key.PDF

  * T1-key.XML

  * T2-key.PDF

  * T2-key.XML

8. Now, you need to design T3 LiveCycle PDF Form which is a a combination of T1 and T2. WARNING: Make sure to desing it so that the design elements (subforms and fields) in T3 are structured in such a way to match those structures in T1 and T2. This way, you will spend much less effort during Data Binding when you want to generate T3. For example, inside T3, create a subform that represents T1 and another one for T2, and then all you have to do, is to bind the root element of the subform, and all the biding of the child elements will be very easy.

But, if T3 structure is a mix of T1 and T2 without any order, then you have to spend a lot of effort in Data Binding in LiveCycle Desinger, or in the way to generate the XML Data when you are rendering T3.

9. Now, it is time to generate T3.

10. User U3 will click a link to generate T3, and the ASP.NET Program must use a primary key as input to locate the XML Data Files of T1 (T1-key.XML) and T2 (T2-key.XML), load them using .NET XML APIs, and extract the data root or relevant nodes, combine and/or merge as needed ---> the end result must be compatible with the desing of T3. Finally, the program must render T3 by merging its template with the newly generated XML Data.

11. If you want to save T3, of course, you need to implement a "Submit" process for this case.

I hope this helps.

Tarek.

Avatar

Level 1

Thanks for the reply, Its really very exhaustive.

There is a slight change :

1. All the PDF processing should happen at Server Side.

2. User U1 do some business process, based upon that

  • T1 is generated, data Pre-Populated hence PDF P1 or XDP is generated at Server
  • T2 is Generated, Data Pre-Populated hence PDF P2 or XDP  is generated at Server

3.The Next step at server should be :

  • Merge PDF P1 and P2 At Server and Hence create a final PDF = P3

4. Render P3 to the end user for View/Save with Reader extenion enabled.

Is it possible to attain ?

If yes can be done through .NET libraries or i need to use LiveCycle ES Services?

TIA

Robin

Avatar

Level 8

Hi Robin,

Following is my feedback:


1. All the PDF processing should happen at Server Side.

If you want to generate the PDF using a XDP (XFA and XML Merged together) and save the result PDF as .PDF File on the server, then the only way I know is to use Adobe LiveCycle ES2 Services which is either in Foundation module or Output Module. You can consume such services as Web Services from ASP.NET.

If you want to do the same using ASP.NET, then you MUST follow the steps below:

a. User Clicks a Link to ASPX Page,

b. ASP.NET Program will use an existing PDF Template (T1) and merge it with XML and must render the result to the browser as MIME as follows:

     Response.ContentType = "application/vnd.adobe.xdp+xml"

c. When the PDF is rendered under the browser completely, there must be a "Save" button on the form to Submit the it to the server (to another ASPX) page, then in the .NET Program you must extract the PDF from the Request Input Stream, and save it to the server as .PDF File.

2. User U1 do some business process, based upon that

T1 generated template data is Generated and Pre-Populated hence PDF P1 or XDP is generated at Server
T2 Generated, Data Pre-Populated hence PDF P2 or XDP  is generated at Server

Note: T1 is the Empty PDF LiveCycle Form, and T1 + XML Data = XDP, when rendered inside the Browser, it will show as PDF then it can be saved as PDF.

The above is possible only using Adobe LiveCycle Services, becuase you want the PDF to be generated and saved on the Server directly without involving the client.

You need to think very carefully about what is the objective? Do you want to have a Physical .PDF File after Generating the Data for T1? If you do not want to end up with a Physical PDF after Generating P1, then you only need to generate the XML Data and save it as a text .XML File. Anytime you want to render it to the client, you can Merge T1 with its XML Data, and render it to the client as XDP.


3.The Next step at server should be :

Merge PDF P1 and P2 At Server and Hence create a final PDF = P3

If you mean combining 2 binary PDF Files, then the only way is to use LiveCycle ES2 Services or some 3rd party tools.

So, if P3 = P1 + P2, without any changes in the layout of P1 nor in P2, then you need PDF output or some other tools.


4. Render P3 to the end user for View/Save with Reader extenion enabled.

The only way to do this is to use LC Services or some 3rd party tools.

Tarek.

Avatar

Former Community Member
There is no language in the form

The buttons is submit buttonts with an url.

You cant submit to a pdf you are always submitting to a aspx.

ulf.a@dtp-tjanst.se

Avatar

Level 8
OK, great ! it is working fine. Thank you so much.



I need now to do the opposite, ie, submit the PDF From to ASP.NET, where the PDF Form has Digital Signature. I want to preserve the integrity of the PDF on the server.



So, I created a Submit Button on the LiveCycle PDF Form and want to submit the Entire PDF using the appropriate Submit Format such as "XDP" , "PDF", or "XML" or what ever. Under APS.NET, I managed to receive the XDP XML Structure using ASP.NET as follows:

----

Dim reader As New System.IO.StreamReader(Page.Request.InputStream)

Dim xmlData As String = reader.ReadToEnd()

Dim xmldoc As New System.Xml.XmlDataDocument

xmldoc.LoadXml(xmlData)

Response.Write("

Welcome " & xmldoc.GetElementsByTagName("Name")(0).innertext & "

")

----

Where "Name" is the Staff Name Field on the PDF Form.



The above code is working fine, but how I can receive the Entire PDF with Digital Signatures and save it to a local folder on the server?



I found a "chunk" element, but I could not write it to Binary File as it is always being written as TEXT File no mater what I do.



It seems that I need and SDK for APS.NET.



Any one can help me I really appreciated it.



Tarek.