Populating a pdf form from a database

There seems to be a lot of information on the forum that skirts around this problem, but so far everything I've tried falls short.
<br />
<br />I have a pdf form that can be filled out via a browser (the web server is Win2k and IIS.
<br />
<br />I can fill out this form and use an http submit button to send it to a .asp url where a vbscript program captures the data and creates a record in a sql server table.
<br />
<br />What I want to be able to do is call up that pdf form and populate it with the data from a specific record from the table - again using .asp and vbscript. The following code brings up the form, but does not fill in the fields. Is what I want to do possible and if so can someone help?
<br />
<br />Thanks.
<br />
<br />Dave Space
<br />
<br /><%@ LANGUAGE = VBScript%>
<br />
<!--#include virtual="/Common/adovbs.inc"-->
<br /><%<br />On Error Resume Next<br />TableName = Request.Form("TableName")<br />Set Conn = Server.CreateObject("ADODB.Connection")<br />Conn.Open "Database=fff;DSN=fff;UID=myuid;Password=mypass"<br />Set RS = Server.CreateObject("ADODB.Recordset")<br />RS.CursorLocation = adUseServer<br />RS.CursorType = adOpenKeyset<br />RS.LockType = adLockOptimistic<br />RS.Open "Select * from iacuc where id = 4", Conn, , , adCmdText<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 />For Each item in RS.Fields<br /> If InStr("IPADDR ID", uCase(item.name)) = 0 Then<br />  Response.Write("<"&item.name&">"&item.value&"</"&item.name&">")<br /> End If<br />Next<br />RS.Close<br />set RS = nothing<br />Conn.Close<br />Set Conn = Nothing<br />Response.Write "</form1>" <br />Response.Write "</xfa:data>" <br />Response.Write "</xfa:datasets>" <br />Response.Write "<pdf href=""http://aaa.bbb.edu/pdf_forms/aaa.pdf"" xmlns=""http://ns.adobe.com/xdp/pdf/"" />" <br />Response.Write "</xdp:xdp>" <br />Response.Flush <br />Response.End <br />%>

David,<br /><br />Can you try to loop through your recordset before doing any of the Response.Write(). Save the the output in a string called "mystring" and output it at the end? So it would look something like this:<br /><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(mystring)<br />Response.Write "</form1>" <br />Response.Write "</xfa:data>" <br />Response.Write "</xfa:datasets>" <br />Response.Write "<pdf href=""http://aaa.bbb.edu/pdf_forms/aaa.pdf"" xmlns=""http://ns.adobe.com/xdp/pdf/"" />" <br />Response.Write "</xdp:xdp>" <br />Response.Flush <br />Response.End <br />%><br /><br />Can you tell me what is your "mystring" look like? See if you get a different result?

Similar Messages

  • Programmatically filling in fields of an interactive PDF form from a database

    I have a web app written in Grails, but it doesn't matter. I ask is there possible way to send the data from database into the the third party interactive PDF form? If yes, what tools from Adobe I would need to make this kind of web app plugin? Is it possible to view Javascript code of once made PDF?

    You can simply create an FDF or XFDF file and return that to the browser.

  • Populating a PDF form from database

    I have asked this question here several times, but never get any replies. In fact my questions seem to be The Only ones that don't get a reply, which makes me think no one actually knows how to do this or my question is so remedial that no one is bothering. I'll try one more time.
    /prays someone takes pity...
    I have created a form that contains a subform with 4 text fields. The fields are read only and the form will be used only for printing. I have also connected to my Oracle database successfully and can populate the fields with data. My problem is I only get the first record. I have the subform set to repeat the data but am having no luck accomplishing this. I always just get the first record. Any suggestions would be more than appreciated as I have been fighting this for about a week now.
    Thanks for any help.

    Dear Robert,
    Please first make sure that your form is dynamic, I mean, just create an Add button that clicking on it you will be able to create more rows. (there are many examples in the forum)
    Once you got it you will have to create a function like this, please note that I have copied an pasted them without changing the objects, maybe you will need to change some of them, be careful
    function populateDB()
    var sDataConnectionName = "Oracle"; // name of the data connection to get the data from. Note the data connection will appear in the Data View.
    // Search for sourceSet node which matchs the DataConnection name
    var nIndex = 0;
    while(xfa.sourceSet.nodes.item(nIndex).name != sDataConnectionName)
    nIndex++;
    var oDB = xfa.sourceSet.nodes.item(nIndex);
    oDB.open();
    oDB.first();
    // Search node with the class name "command"
    var nDBIndex = 0;
    while(oDB.nodes.item(nDBIndex).className != "command")
    nDBIndex++;
    // Backup the original settings before assigning BOF and EOF to stay
    var sBOFBackup = oDB.nodes.item(nDBIndex).query.recordSet.getAttribute("bofAction");
    var sEOFBackup = oDB.nodes.item(nDBIndex).query.recordSet.getAttribute("eofAction");
    oDB.nodes.item(nDBIndex).query.recordSet.setAttribute("stayBOF", "bofAction");
    oDB.nodes.item(nDBIndex).query.recordSet.setAttribute("stayEOF", "eofAction");
    // Search for the record node with the matching Data Connection name
    nIndex = 0;
    while(xfa.record.nodes.item(nIndex).name != sDataConnectionName)
    nIndex++;
    var oRecord = xfa.record.nodes.item(nIndex);
    // Find the node representing the columns in the table
    var oCol1Node = null;
    var oCol2Node = null;
    var oCol3Node = null;
    for(var nColIndex = 0; nColIndex < oRecord.nodes.length; nColIndex++)
    if(oRecord.nodes.item(nColIndex).name == "C1") // column 1
    //app.alert(oRecord.nodes.item(nColIndex))
    oCol1Node = oRecord.nodes.item(nColIndex);
    else
    if(oRecord.nodes.item(nColIndex).name == "C2") // column 2
    oCol2Node = oRecord.nodes.item(nColIndex);
    else
    if(oRecord.nodes.item(nColIndex).name == "C3") // column 3
    //app.alert(oRecord.nodes.item(nColIndex))
    oCol3Node = oRecord.nodes.item(nColIndex);
    var secuencial;
    var secuencial_ant;
    var oNewRow;
    secuencial_ant = 0;
    while(!oDB.isEOF())
    // create new row in Table1
    if (oCol3Node.value != secuencial_ant)
    oNewRow = xfa.form.Formulario1.Linea_detalle.Bordes.Campos.instanceManager.addInstance(false);
    app.alert(oCol1Node.value);
    app.alert(oCol2Node.value);
    app.alert(oCol3Node.value);
    rellenaCampo(oCol1Node.value ,oCol2Node.value);
    secuencial_ant = oCol3Node.value;
    oDB.next();
    // Restore the original settings
    oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sBOFBackup, "bofAction");
    oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sEOFBackup, "eofAction");
    // Close connection
    oDB.close();
    function rellenaCampo(NombreCampo, ValorCampo)
    var obj = xfa.form.resolveNode(NombreCampo);
    if (obj != null)
    obj.rawValue = ValorCampo;
    Its read an Oracle DB table named T1 with three colums, name of the field, value and position into the list of fields (row 0, row 1, etc).
    The second function just fill the field, the parameters are FieldName and FieldValue.
    This codes are from the forum, I had your same problem and searching in it I founded it.
    BR

  • How can i retrieve documents(.doc,.pdf, .txt) using forms from the database.

    How can i retrieve documents(e.g .doc,.pdf, .txt etc) using forms from the database.
    i inserted the documents using sql*loader, below is the control and data files.
    -- control file
    LOAD DATA
    infile 'load.txt'
    INTO TABLE husman
    APPEND
    FIELDS TERMINATED BY ','
    (id integer external,
    fname FILLER CHAR(50),
    docu LOBFILE(fname) TERMINATED BY EOF)
    --data file
    1,../husman/dell.doc,
    2,../husman/me.pdf,
    3,../husman/export.txt,
    in the form i have a text field to display the id and an OLE container to display the document as an icon. but when i execute query, i only get the id number and not the document.
    any help will be appreciated.
    Thanks
    Hussein Saiger

    Step by step
    1. Erase all contents and settings
    2. You'll be asked twice to confirm
    3. You'll see Apple logo and progress bar
    4. You'll see a big iPad logo on screen
    5. Configuration start
    6. Set language
    7. Set country
    8. Enable Location Service
    9. Select network, enter password and join network
    10. You'll be given 3 options (a) Setup as New iPad (b) Restore from iCloud Backup (c) Restore from iTune Backup
    11. Selected Restore from iCloud Backup
    12. You'll be required to enter Apple ID and Password
    13. Agree to Terms and Conditions
    14. Select Backup file
    15. You'll see progress bar
    16. Red slider will appear; slide to unlock; step #1 to #16 is fast
    17. Pre-installed apps will be restored first
    18. Message: Purchased apps and media will now be automatically downloaded
    19. You'll see a pageful of apps with Waiting/Loading/Installing
    20. Message: Some apps cannot be downloaded, please sync with computer

  • Dynamically populating a dropdown list in a pdf form from a datasource

    Is there a way to populate a dropdown list in a pdf form from a datasource, specifically from an Access database table or query, using LiveCycle Designer. I am easily able to do this using cfselect in Coldfusion, however, cannot seem to figure it out for pdf forms. I am aware of the Show Dynamic Properties option enabled in LiveCycle Designer, and then binding to a datasource. However, this seems limited as I am only able to select single columns from Access (currently using an Access database) tables, and a unable to select from queries like I do using cfselect in Coldfusion forms. Is this something that must be done with Java scripting? If so, is there any other way? I know nothing about scripting. Thanks

    Derrick,
    There is a sample posted at
    http://www.adobe.com/devnet/livecycle/articles/lc_designer_db_lookup_tip.pdf
    It was created for Designer 7.0 but it should function the same in later versions of Designer.
    Steve

  • I am working in Adobe Acrobat 9 Pro and just created a pdf form from a MS Word document. I need to find out how to have a date field in my form which will update automatically. Can some one out there help me?

    I am working in Adobe Acrobat 9 Pro and just created a pdf form from a MS Word document. I need to find out how to have a date field in my form which will update automatically.

    Update automatically under which circumstances, exactly?

  • Creating a PDF form from a docx or xlsx

    Hello,
    Pulling my hair out over here... Can you help me out?
    I am trying to create a PDF form from either a word or an excel file.
    When I choose File > Create > PDF Form, I get the dialouge box asking to use either a file or scan from paper. Choosing file, then hitting next shows the choice of current document or browse for file. I browse for file, find my docx file, but it shaded out. Docx or xlsx does not appear in the "show" drop down below, which suggests that this function doesn't support these formats. HUH?
    I have read & watched the tutorials linked below, both of which clearly say Word and Excel are supported.
    http://help.adobe.com/en_US/acrobat/pro/using/WSB3F26303-0F1D-494a-BC55-7BF7F6684B4D.html
    http://tv.adobe.com/watch/learn-acrobat-x/getting-started-creating-simple-forms/
    Then I noticed a difference in the create window from the video, to my version...
    The video says "(PDF, Word, Excel or other file format)":
    My pop-up says ONLY PDF:
    Whats going on?
    I am using:
    MAC OSX 10.7.4
    Office 2011 MAC
    Acrobat X Pro 10.1.3
    Only way I can create a Form from Word files is to first print it to PDF, then use the form wizard on the PDF file... Which seems to have POOR results in auto-recognizing fields.
    PLEASE HELP Adobe!
    Thanks.

    I just got Acrobat X for my mac, for a class.  I am SO frustrated.  Almost everything in the class focuses on PDFMaker options.   The 'save as adobe pdf' or save as pdf options have zero functionality.  So I now own PDF software that doesn't really function on a MAC, and have to go to a windows machine.  I keep reading that it is a Microsoft problem, but I don't know how that can be when the software I thought I bought is this fancy PDF software that converts everything!!
    I asked a tech today if there were 'any' adobe work-arounds for this and basically the answer is to save PDF with no attribute functionality.  Period.
    Wasted $$ for me

  • I created a pdf form from a Word doc with 9 pt aerial font formatting; the text on the pdf form is aerial 9 pt, but the fields are formatted in courier 12 pt - How do I reformat the font in the fields??

    I created a pdf form from a Word doc with 9 pt aerial font formatting; the text on the pdf form is aerial 9 pt, but the fields are formatted in courier 12 pt - How do I reformat the font in the fields??

    You can set up a temporary button (or link, bookmark, etc.) and add the following JavaScript action:
    // Mouse Up script for a temporary button (or bookmark, etc.)
    // Change the font and font size for all text fields in this document
    for (var i = 0; i < numFields; i += 1) {
        var f = getField(getNthFieldName(i));
        if (f.type === "text") {
            f.textFont = font.Helv;
            f.textSize = 9;
    It also sets the font size, but you can remove that line if you don't need to do that.

  • I need to add an attachment to a pdf form from the SBA it is OIC_TABS_NGPC_nl.pdf

    I need to add an attachment to a pdf form from the SBA it is OIC_TABS_NGPC_nl.pdf

    Do the people who made the form SAY you can add an attachment? If not, do not consider it. The form will probably be read by a computer, so it will only look in the form fields provided.

  • HT2506 I am trying to fill out a PDF form from an internet site, but when I go to print it, none of the content prints, only the header of the document.  Help!

    I am trying to fill out a PDF form from an internet site, but when I go to print it, none of the content prints, only the header of the document.  Help!

    Instead of printing it, try saving it as a pdf from the print menu, and then printing the pdf out.

  • When I try to open a PDF form from a site, my screen goes black.

    When I try to open a fillable PDF form from any web site my screen goes black and nothing further happens. I can use IE with success, but would prefer Firefox.

    You're welcome.
    Could you please click the "''Solved It''" button next to the post which solved the problem for you? This will help others searching for a solution to the same question.
    Thanks.

  • Fill out a pdf form from ADF application

    Hi
    I need to fill out a PDF form, from my ADF application and i want to know if exist a component or libarary to do this.
    i hope you can help me
    Regards.

    Hi,
    two options are:
    Oracle BI Publisher (by far best choice but needs to be licenced)
    http://www.oracle.com/technology/pub/articles/vohra-jdev-xmlpub.html
    Jasper Reports, Free but not as functional or easy to use as BIP
    http://jasperforge.org/projects/jasperreports
    Both products have Java API's which you can integrate with your application.
    Brenden

  • PDFMaker missing files issue with PDF Forms from Office 2007

    Hi,
    I have Adobe PDF 8.0 Pro installed  (full installation) and I upgraded office from 2003 to 2007 AND Windows from 2000 to XP Pro.
    I used to be able to create PDF Forms from an Excel document when using Office 2003.
    Now, when I choose to create a new form starting with an electronic document [from an Excel 2003 document (.xls)], I get this error message:
    "PDFMaker files are missing, would you like to repair?" (please image attached)
    I did the repair. Did not worked.
    I made sure the add-in in office was enabled. Did not worked.
    I un-installed Adobe 8.0 Pro and Adobe Reader 9.0 and re-installed only Adobe 8.0 Pro , thinking there was a problem there. Did not work.
    I googled for more answers, did not find anything else.
    I am able to "print as Adobe PDF", I can create normal PDF documents, but not the Forms.
    I used that option all the time for work. Can someone help me please?!!
    Thanks!
    Gwen

    Bill, it worked!!
    I updated to 8.1.6 and now I can use an electronic document to create a form.
    Thank you!
    I have another question: in the past, to enable Acrobat READER users to fill out a form and save it on their computer, all I had to do is "Enable Usage Rights in Adobe Reader" in the "advanced" menu of Acrobat Pro.
    I did just that but my colleagues who have Adobe Reader 9 cannot fill the form. It appears as a scanned PDF document to them.
    Any idea why?!
    Gwen

  • Pulling a PDF file from the database

    How would I display a pdf file from the database, or should I convert it to an image and if so how do I convert it into an image?

    Hi Phil_Kenya,
    Some samples here:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/db1556be-0f71-41cb-92de-b95f1e1ca3a3/how-can-i-load-a-pdf-file-in-my-database-filemdf-in-aspnet-web-project?forum=csharpgeneral
    http://stackoverflow.com/questions/7747796/displaying-pdf-files-in-a-web-page-from-a-sql-database-directly-without-needing
    I suggest you post this issue to the language development forum like above case, I think you would get more dedicated support.
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to mail pdf file from oracle database 11g

    Hi,
    Using following code to send pdf file from oracle database.
    DECLARE
    v_From VARCHAR2(80) := '[email protected]';
    v_Recipient VARCHAR2(80) := '[email protected]';
    v_Subject VARCHAR2(80) := 'test subject';
    v_Mail_Host VARCHAR2(30) := '116.214.31.249';
    v_Mail_Conn sys.utl_smtp.Connection;
    crlf VARCHAR2(2) := chr(13)||chr(10);
    BEGIN
    v_Mail_Conn := sys.utl_smtp.Open_Connection(v_Mail_Host, 26);
    sys.utl_smtp.Helo(v_Mail_Conn, v_Mail_Host);
    sys.utl_smtp.Mail(v_Mail_Conn, v_From);
    sys.utl_smtp.Rcpt(v_Mail_Conn, v_Recipient);
    sys.utl_smtp.Data(v_Mail_Conn,
    'Date: ' || to_char(sysdate, 'Dy, DD Mon YYYY hh24:mi:ss') || crlf ||
    'From: ' || v_From || crlf ||
    'Subject: '|| v_Subject || crlf ||
    'To: ' || v_Recipient || crlf ||
    'MIME-Version: 1.0'|| crlf ||     -- Use MIME mail standard
    'Content-Type: multipart/mixed;'|| crlf ||
    ' boundary="-----SECBOUND"'|| crlf ||
    crlf ||
    '-------SECBOUND'|| crlf ||
    'Content-Type: text/plain;'|| crlf ||
    'Content-Transfer_Encoding: 7bit'|| crlf ||
    crlf ||
    'some message text'|| crlf ||     -- Message body
    'more message text'|| crlf ||
    crlf ||
    '-------SECBOUND'|| crlf ||
    'Content-Type: file;'|| crlf ||
    ' name="D:\mail\pdfSample.pdf"'|| crlf ||
    'Content-Transfer_Encoding: 8bit'|| crlf ||
    'Content-Disposition: attachment;'|| crlf ||
    ' filename="D:\mail\pdfSample.pdf"'|| crlf ||
    crlf ||
    'CSV,file,attachement'|| crlf ||     -- Content of attachment
    crlf ||
    '-------SECBOUND--'               -- End MIME mail
    sys.utl_smtp.Quit(v_mail_conn);
    EXCEPTION
    WHEN sys.utl_smtp.Transient_Error OR sys.utl_smtp.Permanent_Error then
    raise_application_error(-20000, 'Unable to send mail: '||sqlerrm);
    END;
    Above code executed successfully and mail is send to recipient but file is corrupted.
    I think it doesn't pick file from specified location, attachment name is appearing like this 'D:mailpdfsample.pdf
    Oracle Database : 11g R2
    O.S : windows 7 Professional
    Thanks in Advance

    parapr wrote:
    sys.utl_smtp.Helo(v_Mail_Conn, v_Mail_Host);The above violates RFC 5321 section 4.1.1.1
    '-------SECBOUND'|| crlf ||
    'Content-Type: file;'|| crlf ||
    ' name="D:\mail\pdfSample.pdf"'|| crlf ||
    'Content-Transfer_Encoding: 8bit'|| crlf ||
    'Content-Disposition: attachment;'|| crlf ||
    ' filename="D:\mail\pdfSample.pdf"'|| crlf ||Invalid Mime header above. Filename are logical. Not physical. Loose the drive and directory names. The filename is there to name the Mime body's content.
    crlf ||
    'CSV,file,attachement'|| crlf ||     -- Content of attachmentHow is the above PDF content? This is a string containing the text CSV,file,attachement. Which means when this is what is saved as a PDF file by the mail reader.
    EXCEPTION
    WHEN sys.utl_smtp.Transient_Error OR sys.utl_smtp.Permanent_Error then
    raise_application_error(-20000, 'Unable to send mail: '||sqlerrm);
    END;Silly. Why change meaningful exceptions into a generic meaningless exception?? That does not make any sense.

Maybe you are looking for

  • Painting Sharpness in an Adjustment Layer

    Is there a way you can paint in sharpness or blur for that matter? Can you use sharpness as an adjustment layer?

  • Currency Symbol in Project Server 2007

    Hi, Is it possible to change the currency symbol resource wise in Project Server 2007? I need a resource rate to be in INR and another resource rate should be in GBP. K.Gokulraj

  • I am unable to access the Itunes Store. Freezes my pc

    I have upgraded to the latest version of Itunes.  I have removed and downloaded again.  Still not working.

  • Bootstrap mode issue

    At the time of running psadmin.sql, I gave sysadm/sysadm as user-id and password. later at the time of DBSETUP to import Peoplesoft data, I use PS/PS as it also show in right most corner as bootstrap mode. now, I am trying to open the app designer. b

  • Having issues running a VI in 8.5 that runs in 7.1.1

    I am getting an error when trying to run a VI in 8.5.  I get the error: "Registry entries not found.  The program may not run properly.  Please reinstall Snp DLL." I can open and run the VI with 7.1.1 and have no errors.  When I open the VI in 8.5, I