How to email PDF form as an attachment?

Hi All,
I have developed online interactive form app(dynamic).
When user clicks the submit button after entered the data,
I want to email the PDF form as an attachment to some users.
Could anyone please explain the steps or give me some sample code?
Thanks
Sundar

I found this in one of the forums dont remember which, here is the code
  public boolean EmailForm( java.lang.String pernr, java.lang.String toEmail, java.lang.String fromEmail )
    //@@begin EmailForm()
boolean flag = true;
   try {
    String host = "exchangerelay.yourserver.com";
    //    Get system properties
    Properties props = System.getProperties();
    //    Setup mail server
    props.put("mail.smtp.host", host);
    //    Get session
    Session session = Session.getDefaultInstance (props, null);
    //    Define message
    MimeMessage message = new MimeMessage(session);
    byte[] b = wdContext.currentContextElement().getPdfSource();  
   //Attachment
    ByteArrayInputStream ba = new ByteArrayInputStream(b);
    String filename ="Filename.pdf";
    //This will create a file on the server under folder "server0"
   File file = new File(filename);  
    FileOutputStream fos = new FileOutputStream(file);
    int i = 0;
    for (i = 0; i < b.length; i++) {
     fos.write(b<i>);
    fos.close();  
    DataSource source = new FileDataSource(file);
    BodyPart messageBodyPart = new MimeBodyPart();
    message.setFrom(new InternetAddress(fromEmail));
    message.addRecipient(
     Message.RecipientType.TO,
     new InternetAddress(toEmail));
    message.setSubject ("Subject : ");
    message.setText(
     "This is a confirmation receipt.");
    Multipart multipart = new MimeMultipart();
    messageBodyPart.setDataHandler(new DataHandler(source));
    messageBodyPart.setHeader("Content-Type", "application/pdf");
    messageBodyPart.setFileName(filename);
    multipart.addBodyPart(messageBodyPart);
    message.setContent(multipart);
    Transport transport = session.getTransport("smtp");
    transport.connect(host, "username", "password");
    transport.sendMessage(message, message.getAllRecipients());
    transport.close();  
    flag = true;
    //delete file if you want to here
    file.delete();
   } catch (FileNotFoundException e) {
    flag = false;
    wdComponentAPI.getMessageManager().reportException(
     "FileNotFoundException : " + e.getMessage(),
     false);
   } catch (IOException e) {
    flag = false;
    wdComponentAPI.getMessageManager ().reportException(
     "IOException : " + e.getMessage(),
     false);
   } catch (MessagingException e) {
    flag = false;
    wdComponentAPI.getMessageManager().reportException(
     "MessagingException : " + e.getMessage(),
     false);
   return flag;
    //@@end
thanks,
Sanketh

Similar Messages

  • How to email PDF form as attachment?

    Hi All,
    I have developed online interactive form app(dynamic).
    When user clicks the submit button after entered the data,
    I want to email the PDF form as an attachment to some users.
    Could anyone please explain the steps or give me some sample code?
    Thanks
    Sundar

    Hi Sundar,
    I suggest you to see<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2c678dc3-0401-0010-3c80-8ef48f450491">this.</a>
    Regards,
    Ram.

  • I have created a form in InDesign, exported to a pdf, created an editable form and saved.  When I open the form and make changes and save, the reopen the changes are there.  If try to email this form as an attachment after editing, the attachment is alway

    I have created a form in InDesign, exported to a pdf, then created an editable form and saved.  When I open the form and make changes and save, then reopen the changes are there.  If try to email this form as an attachment after editing, the attachment is always minus the edits.   ????

    Hi chuck,
    If you ave created the form and then filling it yourself and saving the form, the filled data should be there when you reopen the same form.
    Can you please send the form to me at [email protected]  so that I can have a look.
    Regards,
    Rave

  • How to save Pdf form localy without internet

    How to save Pdf form localy without internet?
    I thought in the beginning about advanced user rights and pure saving them on adobe reader but i saw legal notes about 500 user who can legaly save it localy and answer to me (bu they can`t answer to my client who paid me for doing this form).
    Other thing is to do Air Application which would collect data from Pdf Form and save it (localy without internet) to use it later.
    I thought about that second possibility but i can`t find any clue to do it myself.
    Any help will be appreciated...

    Hi,
    Are you downloading responses as PDF forms after forms are submitted? If so, FormsCentral doesn't provide an option to exclude empty fields and you won't be able to save PDF forms without empty fields.
    You can use this form to "vote" on popular feature requests, or to add a new one of your own:
    https://adobeformscentral.com/?f=XnF-KJVCovcEVQz9tZHYPQ
    Thanks,
    Wenlan

  • How to create pdf forms in wda

    how to create pdf forms in wda

    hi,
    check these links
    https://www.sdn.sap.com/irj/sdn/adobe
    https://www.sdn.sap.com/irj/sdn/interactiveforms-elearning
    http://help.sap.com/saphelp_nw2004s/helpdata/en/37/47a2be350c4ac8afe36b691203971f/frameset.htm
    The following links contain all the detailed information (PDF & PPT docs) on Adobe Interactive Form with examples which wil make u'r learning easier:
    https://www.sdn.sap.com/irj/sdn/adobe
    Improving the Performance of Adobe® LiveCycleu2122 Designer Forms(scripting)
    http://www.adobe.com/devnet/livecycle/articles/lc_designer_perf_guidelines.pdf
    Interactive Forms Based on Adobe Software: Overview
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e635e290-0201-0010-a9be-9e8e4ce04770
    Adobe Interactive Forms
    http://www.saplounge.be/Files/media/pdf/Huberland-Interactive-Forms-2007.10.10.pdf
    Taking interactive forms to next level
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8c103c36-0301-0010-cda8-f6b381bedb6e
    Introduction to Adobe PDF Library SDK(PDFL SDK)(Simply scroll the document)
    http://partners.adobe.com/public/developer/en/webseminars/PDFL_WebSeminar.pdf
    Creating Interactive forms in webdynpro for java
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5f27e290-0201-0010-ff82-c21557572da1
    PDF-Based Print Forms/SAP Interactive Forms by Adobe
    http://help.sap.com/saphelp_nw04s/helpdata/en/c8/4adf7ba13c4ac1b4600d4df15f8b84/frameset.htm
    Date Objects in Adobe Designer
    http://help.sap.com/saphelp_nw04/helpdata/en/dd/60694fddb74ad88cdb7d2a094f3dd2/frameset.htm
    Checking and Testing a PDF-Based Print Form
    http://help.sap.com/saphelp_nw04s/helpdata/en/c2/1fe9aa4d7b413e8515f90b73729e97/frameset.htm
    Architecture
    http://help.sap.com/saphelp_nw04/helpdata/en/f2/21021b911f4c0cae11459a4ce0bc62/frameset.htm
    http://www.nl4b.com/Adobe/Invitation_SAPBrussels_Q407.pdf
    Yogesh N

  • How to do pdf form from doc in Formscentral

    Hi,
    I would like to know how to make pdf form in formscentral with doc file

    You will have to use Acrobat to convert from doc to PDF, add the fields in Acrobat, and upload to the FormsCentral service. If you don't know how to do any of this, post again and let us know which steps you need more help with.

  • I HOW I FILL PDF FORM WITH HEBROW ON CHROME ?

    I HOW I FILL PDF FORM WITH HEBROW ON CHROME ?

    Chrome uses its own (incompatible) PDF viewer.
    Download the PDF to your local disk, then fill it from there with Adobe Reader.  Or use a browser that uses the Adobe PDF plugin.

  • How to make PDF forms work in DreamWeaver

    How to make PDF forms work in Dreamweaver

    Look at DW's starter pages called "liquid" (FILE | New > Blank Page > "2 column, liquid" etc., or Google "liquid layouts".

  • How to save PDF form without empty fields ?

    Hello,
    I try to find how to save PDF forms after a school registration but without empty fields because i have lots of relation in my Form but i haven't.
    Is it possible and how ?
    Thanks

    Hi,
    Are you downloading responses as PDF forms after forms are submitted? If so, FormsCentral doesn't provide an option to exclude empty fields and you won't be able to save PDF forms without empty fields.
    You can use this form to "vote" on popular feature requests, or to add a new one of your own:
    https://adobeformscentral.com/?f=XnF-KJVCovcEVQz9tZHYPQ
    Thanks,
    Wenlan

  • How to: Secure pdf form that is emailed and later uploaded

    We have a pdf form that will be posted on our website.  Local college/university faculty will link to the form on their websites or just give students the link to our page.  Students will fill the form and it will be emailed to a faculty member from their specific school.  The faculty member then needs to review the form and select candidates to present for an internship.  At that point, they need to upload the form back to our server.
    This form will contain sensitive information and therefore needs to be secure during the filling, emailing, and uploading processes.  The faculty member receiving it needs to be able to access it as does the person on our end that will do the final reviewing after it is uploaded back to us.
    I have no idea how to even start.  I've created interactive forms but have never embedded one in an website.  The closest I've come is a recently created web application that filled a pdf form in the code-behind and then emailed it, but that didn't require any security.
    Any help will be appreciated.

    Yeah I kinda figured that... Really too bad. Seems lke it should be possible somehow. Anyway, do you all have any suggestions about the best way to combine a static form that is really just text fields and such (that comments and markup tools can be used in) with another page that is sections of narrative that would need to be able to flow?
    Or better yet, a way to draw lines on to a form without using the comment and markup function?
    I like your idea about connecting two forms - but I need to keep the final product as simple as possible. Once the user fills it out, they would be to be able to submit it and it show up as one file, even if that is just a flat file. I don't expect you all to tell me how to do this, but it would be nice to know its possible before I commit to the project and research. Thanks in advance.

  • How to send PDF file as an attachment in email?

    Hi Folks,
    I have successfully configured SMTP and by now I can successfully send normal text messages along with .TXT files. However, when I am trying to send an email along with .pdf file as an attachment, I am getting the mail in my inbox, but I cannot open the .pdf file! I am getting the following Acrobat error:
    Acrobat could not open 'abc.pdf' because it is either not a supported file type or because the file has been corrupted
    Can any help me in solving this problem?
    Thanks in advance
    Regards,
    Faisal

    Hi Vajha,
    Thanks alot for your kind reply. I also express my apologies for responding to your reply lately.
    I beleive all the links you have sent me are talking about ABAP coding. what I am interested in is,
    is there any configuration that I am missing in SCOT (Basis side)?
    Since I am not an ABAPER, so I carry out these activities.
    Can anyone please answer the following queries of mine:
    1. Can't we send any PDF attachment in a mail from R/3?
    2. Do we have to do it through coding only?
    3. In scot we have option "All formats except fllw". But it does not work for me. Any inputs?
    Thanks in advance.
    Regards,
    Faisal

  • How to save PDF form results online

    I have a form that is a job application. I currently have a form made in html that sends the results to an email. The email would contain an array of results. The results are ugly because there are so many different variables. Putting the results into a PDF form would be a lot better. Here are two different options that I have worked up:
    Option 1
    I would like the PDF to be viewed by the user filling out the application and be able to be sent to the company's email directly as a pdf. I do not want the results in XML format or FDF format. The company does not have Acrobat Pro to load the results. Unless there is a way to do it without Acrobat Pro I would like to stay away from that. We are using a PHP5 system.
    Option 2
    I would like the user to fill out a form (non pdf) and my server to process the array and plug in the results into a PDF form that will send to the company's email as an attachment. The form needs to be in PDF format not FDF or XML.
    I have the programming knowledge to send the email. I simply do not know how to get the form in a PDF format after the forms are filled out.
    Thanks for your help!
    --Justin Massey

    Your first option leads for license issues if you have many applicants to deal with. The second option is reasonable, but you would submit the form data (FDF or XML) to a web server that would process the data. The data can then be used to repopulate the form to send to the administrators. I am not sure about the license restrictions on the latter, but I think it is within bounds. The issue with the second approach is the development of the system to do the process.

  • Start process from emailed pdf form

    I've set up a process with an email endpoint that has two steps:
    1. set value (which does nothing)
    2. User task which sends a pdf form to a user.
    the idea is that when a pdf form is mailed to the specified mail account the process starts and sends the pdf to the correct user which then is supposed to review the form and approve it or decline it.
    The process starts correctly on receiving the mail, and the pdf form is attached to the task but it doesn't contain the data that the user had entered before submission, it's empty.
    I've tried submitting the form in all possible formats xml,xdp,pdf, and I've tried changing the type of the process variable, from xfaForm to Document Form, to Document, but I either end up with an empty form, or I get an error when trying to open the form associated with the process task.
    does anyone has a simple example of how to accomplish this?
    I know I am probably making some stupid mistake but for the life of me I can't figure out where the problem is.
    thanks in advance for any help.
    Aldo.

    Thanks a lot for your reply! At them oment i'm having problems with the server on which livecycle is installed. As soon as i get iu back up and running i will mail you the process.
    Tahnks again.
    Aldo.

  • Download the PDF Form as a attachment when button click in BSP application

    Hi All,
    I have scenario, when button click in the BSP application PDF Form want to download in the IE (like one window open with Open,Save and cancel button).
    I have written this code:
    data: pdf type fpformoutput-pdf.
    < Logic for populate value to pdf field ....
    .>
    response->set_header_field(
                         name  = 'cache-control'
                         value = 'max-age=0' ).
      response->set_header_field(
                         name  = 'content-disposition'
                         value = 'attachment; filename=webforms.pdf' ).
      response->set_data( data   = pdf ).
    Once button is clicked pop up is opened and closed automatically because of browser or adobe reader issue.
    How can I resolve this problem ?
    In the IE i need to change any settings ?
    IE version = 7.0
    Adobe reader = 9.0
    I have tried in the same code with IE = 6.0 and adobe reader 8.1.2 its getting download the pdf form working fine.
    The same think i want in IE 7.0 and adobe reader 9.0, what needs to be done ?
    Regards,
    Boopathi M

    Hello Ravi,
    Best would be to bind the dataSource of the InteractiveForm ui element to the parent node containing the table's data. Then specify a name of a template to be created in the templateSource and hit <enter>. Some popups later, the system will have created a template from the structure of the context. All you need to do now is to drag&drop the data structure inside the template designer to the template itself. This will result in a table. Save, activate and return the Web Dynpro view. Don't forget to unbind the pdfSource and enjoy.
    Best regards,
    Thomas

  • Email PDF Form and Sign Entire Submission - Can this lock the form and show the signature?

    Thanks to those who explained how to create a button that allows me to email a form as a PDF rather than XML. It helped me a great deal.
    Now I want to cause our time sheet adjustment form to be emailed from the employee to their supervisor, and have the form-data be read-only, and the employee signature to be obvious to the recipient.
    I've tried checking the Sign Submission check box in the Submit tab of the Button Object window, (where the mailto: tag has been entered.
    I clicked the "Settings..." button on the Submit tab and then, under the "Sign Data and Submit Settings" dialog box I selected "Sign Entire Submission". But this does not lock the data and the resulting PDF form once emailed, shows no sign of a signature.
    I also tried adding a signature field, and clicked on it to add a signature. But once the signature was added, the Button was disabled and I could not submit the form via the mailto: tag.
    Is there a way to signa form with a self-signed signature, and email the entire PDF such that the recipient can see the signature, and that the data are no longer editable?
    Wouldn't that just be ducky...?
    Thanks again,
    -David Bartholomew

    Thanks for your comment. I suppose I need to add a context to my intended usage to explain why I want what I described. I want the signature to be apparent so users can see that a submission was signed. These forms that I am considering will replace a paper form used internally within my organization, to request a time card change. They only need to be signed as a pro-forma requirement.
    If the electronic forms solution is approved by management, I will make a case that since the network is a closed intranet, there is little consequential likelihood that a fellow employee would forge another's time card change request. And since the new form would be submitted through email, there is a further validation that the email will identify the sender's email address. This proposed electronic submission method is certainly as valid as forms where users cut and paste an image of their signature in a document...
    The good news is that since I asked this question, I discovered the samples that came with LCD 8...
    An example can be found in the Live Cycle Interactive Purchase Order sample found at [installdir]\EN\Samples\Purchase Order\Interactive.
    The interactive Purchase Order sample shows how a collection of fields can be defined and then the signature applied only to the data in the collection. The email button is defined as not included in the collection. This way the signature field can be used, and once the document is signed, the email button remains enabled.
    The interactive purchase order sample also demonstrates how a drop down list can be populated by a JavaScript as well as some array handling syntax that I've been looking for.
    I recommend the samples to anyone who, like me, may not have been aware of their relevance.
    Thanks again, this forum is a great resource.
    -David

Maybe you are looking for