#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    2
    Rep Power
    0

    How to create a mailto syntax with attachment on a PDF file?


    Hello everyone, this is my first post so please be gentle!

    Recently, we've introduced a new procedure at work where we will issue questionnaires to customers so that we can evaluate our performance.

    I have created a basic PDF file with check boxes and such, but as questionnaires are usually very mundane and time consuming I want to be able to make this form as quick and simple as possible.

    What I want to do is attach a button at the bottom of the questionnaire which will open the user's default email software and attach the completed questionnaire to the message.

    So far, I've added a mailto syntax which opens the email software with my email address already inserted in the "Send to" bar. What I can't figure out is how to attach the completed form to that message.

    Is this possible through html and if so, please help!

    Much appreciated.
  2. #2
  3. Code Monkey V. 0.9
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2005
    Location
    A Land Down Under
    Posts
    2,102
    Rep Power
    1990
    It's not possible using standard HTML. You can't control a users computer like that. Imagine if you could... you could upload *any* file like that, and that could lead to some very big security and privacy issues.

    If you're doing to do this properly you have two choices. First you can set up a file upload form where users can upload the PDF after they've completed it. It's another step but you can add the link into the form and say "click here to send the form" and users should understand what to do. Second you could ditch the PDF form and do a standard HTML form with the same questions and then either email the answers, save them in a database somewhere or do both.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    2
    Rep Power
    0
    Originally Posted by Catacaustic
    It's not possible using standard HTML. You can't control a users computer like that. Imagine if you could... you could upload *any* file like that, and that could lead to some very big security and privacy issues.

    If you're doing to do this properly you have two choices. First you can set up a file upload form where users can upload the PDF after they've completed it. It's another step but you can add the link into the form and say "click here to send the form" and users should understand what to do. Second you could ditch the PDF form and do a standard HTML form with the same questions and then either email the answers, save them in a database somewhere or do both.
    You make a good point. Ok, so I've built up a very basic form using HTML but I'm not sure how to get the details of that completed form onto our systems. So far, I've made a "submit questionnaire" button at the bottom of the page, but how do I link that button to our website or email address?
  6. #4
  7. Code Monkey V. 0.9
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2005
    Location
    A Land Down Under
    Posts
    2,102
    Rep Power
    1990
    For that you need a server-side langauge like PHP, ASP, JSP, or whatever your server runs. You'll pass the values to that and it will send back whatever the forms values are.

    If you're using PHP, look up phpmailer as that's about the most widely-used one out there.
  8. #5
  9. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    I think PDF might have a built in feature for submitting forms, although I don't know anything about it. An HTML form is a more flexible way to go.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  10. #6
  11. Code Monkey V. 0.9
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2005
    Location
    A Land Down Under
    Posts
    2,102
    Rep Power
    1990
    Originally Posted by E-Oreo
    I think PDF might have a built in feature for submitting forms
    It does. I've seen the designers here try and struggle through it before. It will send values (as long as there's a connection to an email server...) but it doesn't send the complete PDF file. It's also a nightmare to try and set up. it took the lead designer here a day to get it working mostly right. All that for something that I could have thrown together in 30-40 minutes.
  12. #7
  13. No Profile Picture
    Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Location
    New York
    Posts
    28
    Rep Power
    0
    All you need is server-side langauge like PHP, ASP, JSP, or whatever your server runs. If you're using PHP, look up php mailer as many of them have suggested for me.

    Comments on this post

    • Catacaustic disagrees : Didn't I say that? Four days ago???

IMN logo majestic logo threadwatch logo seochat tools logo