Skip navigation

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

Mar 26, 2007 9:38 PM

  Latest reply: anand.padmanabhan, Feb 23, 2013 12:40 PM
Replies 1 2 3 4 ... 7 Previous Next
  • Currently Being Moderated
    May 21, 2008 7:31 AM   in reply to tarekahf
    I am not quite sure we are talking about the same thing but maybe we are?
    Are you saying I should work on creating an .NET aspx page that uses an XML API that reads the XML data from my PDF file?
    I think I understand that part but does the XML API create an .XML file on the server?
    Mark as:
  • Currently Being Moderated
    May 21, 2008 3:42 PM   in reply to tarekahf
    Thanks for the help. I have been doing a lot of research on this and been going nuts because they dont show any examples other than reading from a specific xml from a specific location such as "(Server.MapPath("MySource.xml"));" however, this is not true for a PDF file that is sending the data to an web page - I reviewed your code that you posted but havent been able to decifer how you are doing it. Are you using a specific file from a specific location? in your web code are you using loadXML("filename") because I cant get load(Request) to work...

    again, thanks for your help on this, I have made some progress but not all the way there yet.
    Mark as:
  • Currently Being Moderated
    May 23, 2008 7:03 AM   in reply to tarekahf
    I was able to get it to work, here is a part of my code (this is an .asp page): <br /> <br /><%@Language="VBScript"%> <br /><%Option Explicit%> <br /><%Response.Buffer = True%> <br /> <br /><%<br /><br /> Dim xml<br /> Dim fullpath<br /> Dim dynamicName<br /> Dim infoRFC<br /> Dim infoDate<br /> Dim infoRequestor<br /> Dim infoLocation<br /> Dim infoProject<br /> Dim infoProjectDate<br /><br /> <br />' start the XML object<br /> Set xml = Server.CreateObject("Microsoft.XMLDOM")<br /> <br />'wait for the xml to be read<br /> xml.async = False<br />  <br />'load data transmitted from the PDF form to the web page<br /> xml.load (Request)<br /><br /> <br />'collect information from XML fields<br />infoRFC = xml.GetElementsByTagName("main")(0).text<br />infoRequestor = xml.GetElementsByTagName("Requestor")(0).text<br />infoDate = xml.GetElementsByTagName("input_date")(0).text<br />infoLocation = xml.GetElementsByTagName("Location")(0).text<br />infoProject = xml.GetElementsByTagName("project_name")(0).text<br />infoProjectDate = xml.GetElementsByTagName("AOSDate")(0).text<br /><br /> <br /> <br />'write information to the web page<br />Response.Write(infoRFC + " Submitted!")<br />Response.Write("Requestor: " + infoRequestor)<br />Response.Write("Date: " + infoDate)<br />Response.Write("Location: " + infoLocation)<br />Response.Write("Project: " + infoProject)<br />Response.Write("Project Date: " + infoProjectDate)<br />  <br />  <br /> <br />'save the loaded xml file to a specific location on the server<br />".xml"))<br /> <br />fullpath = Server.MapPath(infoRFC + ".xml")<br /> <br />dynamicName = (infoRFC+".xml")<br /> <br />response.write("File Name: " + dynamicName)<br /><br />%>
    Mark as:
  • Currently Being Moderated
    Jun 28, 2008 5:44 AM   in reply to tarekahf
    This thread is very valuable and full of information.

    Tarek Adnan Faham - I have one confusion that I want to ask.

    From client viewing of PDF than submitting it to asp and saving to database, where we need Adobe Acrobat 8 Professional? . Client who is filling the pdf and submitting don't need Adobe Acrobat 8 Professional on his machine right? acrobat reader 8 will able him to fill the PDF and submit it to aspx page.

    Mark as:
  • Currently Being Moderated
    Jun 28, 2008 6:02 AM   in reply to tarekahf
    Thanks for the quick reply.

    I think that suppose I have website that is immigration related and I have PDF that needs to be filled by user than I am sure he won't buy full version of Acrobat as most of them have Acrobat reader.

    I wanted the user to fill in the PDF data and send it to apx page where I be able to save it in database. Thats what I intend to do. What do you suggest?

    Mark as:
  • Currently Being Moderated
    Jun 29, 2008 5:54 AM   in reply to tarekahf
    Thanks for the reply.

    I searched on Adobe Reader Extension Server but I can not find the cost of it anywhere.

    Do you know the cost of Adobe Reader Extension Server and where to download it for testing?

    So all I need to buy is Adobe Reader Extension Server and I will be able to online PDF forms for users ti fill without needing acrobat and they do it with reader?

    Is there anything more to buy except Adobe Reader Extension Server . Anything at all?

    Thanks for the help.
    Mark as:
  • Currently Being Moderated
    Jun 29, 2008 6:55 AM   in reply to tarekahf
    This thread is indeed very informative!!! Thank you all for the contributions...

    I'm interested in Jeff Lawrence's post as he is using Dreamweaver or a similar product to generate his ASP page.

    I have used his code and was able to make it work. My pdf button is sending the xml data to my ASP page, and i'm able to write them to the test page via Response.Write()

    However, i'm more interested in sending the WHOLE PDF as an attachement and not just the data...anyone out there with help will be greatly appreciated!

    I was thinking of using Jeff's code to save the pdf to the server, then have that file sent to an email and then delete it from the server...does that make sense? Is there a more direct way??

    Thanks guys, you all rock :)
    Mark as:
  • Currently Being Moderated
    Jun 29, 2008 8:21 AM   in reply to tarekahf
    Hello Charlie Taminian,

    >>However, i'm more interested in sending the WHOLE PDF as an >>attachement and not just the data...anyone out there with help will >>be greatly appreciated!

    Problem is the solution needs Acrobat to send data from the client machine to any page asp or aspx etc. Acrobat is expensive and no one will be able to have it on there machine just to fill the form in PDF and send it. I am talking about public web sites like immigration site etc.

    I am looking for a away to spend some money but I get the above functionality without clients having acrobat and they just do it with reader.
    Mark as:
  • Currently Being Moderated
    Jun 29, 2008 3:06 PM   in reply to tarekahf
    Thanks for the reply Pirzada...

    Tarek...i'm glad that you are still active on this thread....I have read your code and it seems that you are pretty well informed on this subject... can you please provide me with a straight forward answer to this question???

    I need to send the WHOLE PDF as an attachment and NOT just the data...

    I see from Jeff Lawrence's code, that he saved the pdf to the server, I can assume that there is also a script to send that same pdf from the server to the email address, thus achieving my goal of sending a pdf as an attachment to an email I correct???

    To make things easier for you....

    My ASP page will:

    1) Read the xml data
    2) Save that data as a pdf on the server
    3) Send that pdf to an email address as an attachment

    Final result is a pdf being sent to an email address as an my logic correct, or is this even possible???....I don't expect you to give me code, as i'm not using .NET so I only expect you to confirm my logic...

    Thanks alot man, your efforts are greatly appreciated!
    Mark as:
  • Currently Being Moderated
    Jun 30, 2008 1:47 AM   in reply to tarekahf
    Thanks alot Tarek, you have been really helpfull...I only expect my clients to fill out the pdf(with reader) and hit all the work is done by ASP.....

    Also thanks for confirming my logic....I can now google around for some sample code, and when I get it to work...I will post it here for others to view...

    Many thanks again

    Mark as:
  • Currently Being Moderated
    Jul 15, 2008 11:01 AM   in reply to tarekahf
    Hi Tarek,

    I am hoping you can help me out, I am trying to create a javascript language in Adobe Livecycle 8 that will populate the body of the form based on the user selections made at the beginning of the form.

    These "weeder" or deciding selections will be based on department, value, and code. I then want there to be a "submit data" button that will populate the body of the form based on the user's responses.

    The body options will be pre-created as a .pdf file and will be "Option1", "Option 2", "Option 3", etc.

    So, for example, if the user selects:

    Dept 1, value A, Code 1 = Option 1
    Dept 1, value B, Code 1 = Option 2
    Dept 2, Value A, Code 2 = Option 3

    there are other variables, but that is the jist of it. Can you help me with what language I would put into that "submit data" button that would accomplish this goal? ANY help you can provide woudl be GREATLY appreciated!!!!!


    Mark as:
  • Currently Being Moderated
    Sep 11, 2008 8:44 AM   in reply to tarekahf
    Charlie Taminian, did you find a VBScript/ASP solution to users submitting a PDF from Acrobat Reader to your IIS server and then sending the PDF as an email attachment? This is exactly what I want to do. Code examples or links to the solution would be greatly appreciated. Thanks.
    Mark as:
  • Currently Being Moderated
    Sep 19, 2008 2:15 AM   in reply to tarekahf
    hi i have exported the PDF filled forms as XML through email option. And i used that XML to populate into a Database. But i want to save the XML directly into my system asking for a location without having a Email option. If anyone could help me please let me know. Also in previous message TAREK has sent a script. I dont know how to use that. I have created a web application and its in my local system. How do i get the XML copied to that location or to web server...
    Mark as:
  • Currently Being Moderated
    Oct 14, 2008 10:43 AM   in reply to tarekahf
    Hi Tarek,

    I have a requirement to display contracts in PDF.
    I am using Adobe 8 professional version on my server.I designed the PDF forms in livecycle designer.
    I am trying to send the contract id from .net application to PDF and to display the contract for this Id with the information from Sql server.

    I am new to livecycle and a little bit confused. How do I pass this ID parameter from .net to pdf form ? Can I do that ?
    I am presently using Scripts to populate the fields in PDF forms in Livecycle,since I have to display dynamic table of data in contracts.

    What i am trying to do is keep the whole processing like accessing procedures, tables etc in pdf script .I don't know how to pass the id parameter and capture this ID paramter in Livecycle javascript to display the data. Can you help me .IS there a better way of doing this ?
    Mark as:
  • Currently Being Moderated
    Oct 16, 2008 5:52 AM   in reply to tarekahf
    Thanks Tarek,

    You have given me a detailed explanation of solving my issue.This is really helpful for me. I don't have much experience with XML,I will work on it.Just out of curiosity,I came to know i can use scripting in livecycle forms when designing,

    * Instead of collecting data from sql database in .net and passing
    the XDP to pdf. Can I pass the contractId from .net and based
    on this id using scripting objects in livecycle forms can i display
    the data?I could do this to some extent like getting the contract
    id through url string in pdf livecycle forms and displaying
    data in form using dataconnection to sql server.
    I am using Acrobat 8.0 professional on my server and making use of
    livecycle designer to design the forms.
    can this form still work if client uses just adobe reader
    (any version?)on his machine.Is there any kind of restriction in using this method instead of creating XDP as you have mentioned. Does this one require Adobe LiveCycle Forms on server?Please let me know.

    Mark as:
  • Currently Being Moderated
    Oct 16, 2008 6:35 AM   in reply to tarekahf
    Thanks Tarek ,

    This was really helpful for me in deciding which method to use. Seeing all these security issues and flexibility I will try working with XML Thanks for your input I really appreciate for your quick response.

    Mark as:
  • Currently Being Moderated
    Oct 20, 2008 8:50 AM   in reply to tarekahf
    Hi Tarek,

    I used your suggestion of using datasets for creating the XML file in .net and sending it to PDF forms as input to display the filled form.

    Instead of using datasets and getXML()I used the .net sqlXMLCommand object and passed in the sql query for XML and using the SQlXMLReader function I could retrieve the sql data in XML format. I then appened this string to generate xdp.

    It works very well for generating even dynamic table data. Thanks for your input.

    This is code i used in .net for generating data in XML format,

    Public Sub test2()

    Dim ms As MemoryStream
    Dim cmd As SqlXmlCommand
    Dim p As SqlXmlParameter
    pid = 2700
    Dim fname As String
    Dim xr As XmlReader
    Dim xmlCatalog As XmlDocument

    fname = "testxml.xml"
    ms = New MemoryStream()

    cmd.RootTag = "form1"
    cmd.ClientSideXml = True

    **** This is function with parameters i am using to get data from sql I couldn't use the Xpath command type since this is a function *****

    cmd.CommandText = "execute getdata ? for XML NESTED,elements"
    cmd.SchemaPath = "testschema.xml"
    p = cmd.CreateParameter()
    p.Value = 2709

    **** use can you Xpath if it is a direct query to sql table and u can also specify the parameters in this command text****************
    'cmd.CommandType = SqlXmlCommandType.XPath
    'cmd.CommandText = "myform"

    xr = cmd.ExecuteXmlReader()
    xmlCatalog = New XmlDocument()

    ********** I store this xml outpput to a file to be read later on for generating xdp*******

    xmlCatalog = Nothing

    End Sub

    I am facing an issue after the display. I used your code for pushing the xml data on to Pdf .Everytime i generate the PDf the response ends, so i have to open up the application again. Is there another way for displaying the pdf without affecting the application window?

    Mark as:
  • Currently Being Moderated
    Oct 23, 2008 12:48 PM   in reply to tarekahf
    Hi Tarek,
    I have the exact same scenario as yours where the user would submit a pre populated form to sever and we have to extract the data form the xml and work with that.
    can you please tell me how do we submit the xdp package to the server.
    and what techinique you have used to extract the pdf and the xml separately.
    any help would be appreciated.
    My envioenment is life cylce designer 8.1, java.

    Mark as:
  • Currently Being Moderated
    Oct 30, 2008 7:11 AM   in reply to tarekahf
    Hi Tarek,

    I figured out I have do this manipulation in .net front end.

    The Solution you have with XML works like a Charm . I have successfully used SQL to create XML files. I have a PDf file which has data from multiple datasets . So i created one XMl file for each dataset and then appened all these files at end to get a single XDP file. Saved the final file as .xdp.

    Then in .net at the click of a button i just used javascript to display this PDf as a seperate window like this,

    s = ""
    s = " "
    ******* tempname is the name of the final XDP file i created *******

    It works perfectly now.

    I am working on another request where the rows in the pdf file should dynamically increase based on the calculation from fields in the XML file.

    I am kinda stuck ..

    I have a XML file which provides input to the pdf.
    This file is used to dynamically create rows in a subform.
    Based on the values in this fields in subform i have to generate table of data which displays calculated income,tax info etc for each row of data.

    The data for this is not coming from an XML. It is calcuated based on the previous one.

    Let me know if you have any sugestions.

    Mark as:
  • Currently Being Moderated
    Oct 30, 2008 7:19 AM   in reply to tarekahf
    Hi Tarek,

    the request put forward was to generate a pdf from the application . once generated and printed we have to go back to the application .

    With the solution before with displaying the pdf using response.flush and response.end(), the pdf displayed perfectly but the whole application was terminated once the pdf was generated. This was not intened. So i figured out a way to create a .xdp and save it in the sever and then use java script to open this .xdp on the client side.

    Mark as:
  • Currently Being Moderated
    Mar 29, 2009 8:35 AM   in reply to tarekahf

    I'm a .NET Developer, I'm pretty new to Livecycle. I started using Livecycle 8.1 last week. I designed my first form.

    I came across this thread, and I want to be able to use a PDF and dynamically populate it with data by injecting XML.

    My requirements are as follow:

    -- Users submit data via a aspx webform. Which gets stored in a SQL database.

    -- After submittion, I need to be able to review these entries, which will be a list of submittions with a link that says: "View PDF". I click on it, and have the ASP.NET page generate XML and launch the PDF premade form, with the values entered by the user.

    --That's it

    I have followed this thread, and I've used some of the code presented. I created a single field form in livecycle, in order to simplify my life and be able to test this method. But every time I run my page it launches the PDF. But the values do not reflect what is fed into the pdf form via XML. The fields in the pdf file is blank.

    Can somebody tell me in the simples way?. A step by step process. Because I don't even know if the way I created the form in livecycle is right.

    Can somebody post a simple example of this?, maybe a sample zip with a PDF and a aspx page.

    I've been at this for two days straight, and this thread has gotten quite large. I might just be missing something.

    PS. I have been able to databind the form directly to my SQL server. But I see no way of passing parameters to PDF or to modify the SQL Command on the fly(To retrieve a specific record).

    Thanks in advance. This will be amazing if I get this to work.

    Mark as:
  • Currently Being Moderated
    Aug 5, 2009 10:16 AM   in reply to tarekahf

    Hi Tarek:

    I am really thankful to you for initiating this thread; I printed all the 50 pages of this thread and went through them over a 2 hour reading. Thanks for being not only an initiator but the major active contributor to this thread. Actually, I am not replying to your question addressed in the thread but asking for some inputs from you.

    Just FYI; I have worked with LC designer 8.1 for more than a year now. I have developed a few Dynamic XML PDF forms which use ODBC connecting option to pull data from MS Access DB ( all client based) to publish the same on the PDF. This app was a 2-Tier approach.

    My current requirement:

    I need to develop the ASP.NET version of the same form developed by me earlier in 2008 so that I can publish this form over an IIS for everyone over the internet to use the form on-demand. I will use a .NET application to accept the Input Parameters (Request) for which the data needs to be fetched from DB and published in the PDF form (over the browser). The final PDF published in the web browser needs to be saved in a WORD document since the clients cannot afford Adobe Acrobat in every client.

    My Limitations: My case is similar to all the limitations mentioned in this thread. Budget does not permit the following.

    1. Cannot buy or install Adobe Reader Extension Server in the Server.

    2. Cannot buy or install Adobe Livecycle Designer ES or Adobe Livecycle Forms.

    3. Cannot buy or install Adobe Acrobat Pro in all the clients

    4. No third party tools are allowed to be installed in the client for any export import purposes.

    Only Adobe Reader 9.0 is allowed for all the clients. All clients will have MS office for sure.

    My Questions:

    1. My complete technical design of the data flow depends on the contained object (PDF form or plain HTML form) rendered in the web browser. The contained object should allow me to save the form embedded in the browser into Word format (saved in the client). Also the word form saved here should have editable form controls for further edits in the manual workflow. I love to use Adobe Livecycle designer since the form look and feel is absolutely great. Do you think I am just trying to waste time? I strongly feel forms are best looking in Adobe LC designer. Do you think I still can use this tool to achieve what I want?

    2. Do you think I should just forget about Livecycle and design a pure Visual Studio form or MS Word Form and be done with export to word using some APIs published by Microsoft?

    2. Also a question answered by you to PIRZADA from your earlier thread dated June 29 2008. You had mentioned that you were planning to develop .NET Class wrapper for the form submission, initiation and Processing. Do you have that class published anywhere? Or could you please share that to this forum.

    I would also appreciate if PIRZADA or anyone like Jeff Lawrence or Vidya could comment on my requirement and suggest an approach or examine my appraoch.

    Mark as:
  • Currently Being Moderated
    Aug 6, 2009 3:04 AM   in reply to tarekahf

    Hi Tarek.

    Thank you very much for your quick response.

    Now, to respond to you...

    Customer cannot afford Adobe LRES at this point of time. I must tell you, at the outset that the form I am working on is a standard form and the look and feel of it should be so close to the paper form. That is the purpose why we chose Livecycle Designer in the first place. So to answer you, specifically, YES! I want to have pure paper replacement as much as possible ( say 70% close to the original paper form). Customer is willing to live with what I give as web-enabled electronic form but I want to give my best. I know HTML form/ASPX form is anyways known options

    So I want to go with what you have told in the first point. to quote you "Or, you can use Single Adobe Acrobat 9 version and Reader Enable the LiveCycle Form on the Server and will give about 70% of the feature provided by Adobe LRES." I hope this means that the I can install and use Single user Adobe Acrobat 9 Professional version (WHICH INCLUDES LC DESIGNER) at the server and Reader Enable the Livecycle form. Yes I can do this. However I need to always remember that any form shown with values on the broswer should be editable and, I should be able to save the browser form into a word document.

    Now my question: Using your idea I came out with the following logic. will this logic work?

    Step 1: Accept Key input params from the user using a .NET application (request object). User submits the data

    Step 2: Fetch the relevant form data (data sets) from the database for the INPUT params

    Step 3: Programmatically Generate instance(s) of the PDF (I call it generated PDF(s)) using the LC designer PDF form by populating the fetched data (sometimes this generation could result in a multi-page form and/or multiple instances of the form)

    Step 4: Store the generated PDF(s) in a SOURCE folder inside the server

    Step 5: Reader Enable the generated PDF(s) "programmatically" using the SINGLE ACROBAT 9 Professional installed in the server( This is your idea!!!!!)

    Step 6: Store the Reader Enabled generated PDF in a DESTINATION folder

    Step 7: Now show the browser (response object) with Reader Enabled generated PDF extracted from the DESTINATION folder

    Step 8: Now from the web broswer allow save of this form into MS-Word ( how this will happen - donot know now..hmm I need to test it out)

    Please feel free to criticize if any of the steps mentioned above is beyond your imagination. If I am sounding too abstract for you, please feel free to comment. I would wait for your valuable feedback. In the meanwhile let me do a Hello world run of the whole logic to test it out. Shall keep you posted.

    Besides. I will, for sure, remind you after Aug 10, 2009 regarding the class you will be publish it for this group



    Mark as:
1 2 3 4 ... 7 Previous Next

More Like This

  • Retrieving data ...

Bookmarked By (0)