Fillable PDF on website.

Discussion in 'Web Design and Development' started by pwhitehead, Mar 23, 2016.

  1. pwhitehead macrumors 6502

    pwhitehead

    Joined:
    Jul 19, 2011
    Location:
    new jersey
    #1
    We're looking to put various fillable PDF forms on a website such as applications, opra request forms, ect.. Is there a way using wordpress that I can put the fillable PDF on a page, have the person fill it out and hit a send button, but instead of having it open up the default email application, it sends a duplicate of the form filled out through a background web mail server? Thanks!
     
  2. superscape macrumors 6502a

    superscape

    Joined:
    Feb 12, 2008
    Location:
    East Riding of Yorkshire, UK
    #2
    It might be easier to look at sending XFDF data back to the server rather than the PDF itself...

    https://partners.adobe.com/public/developer/en/xml/XFDF_Spec_3.0.pdf

    ...then just have a simple script sat on your server that accepts the XFDF and does whatever you want with it.
     
  3. aarond12 macrumors 65816

    aarond12

    Joined:
    May 20, 2002
    Location:
    Dallas, TX USA
    #3
  4. pwhitehead thread starter macrumors 6502

    pwhitehead

    Joined:
    Jul 19, 2011
    Location:
    new jersey
    #4
    Thanks a lot for both of your inputs, anymore advice would be much appreciated.. Yes, we have a full licensed version of Creative Cloud.
     
  5. superscape macrumors 6502a

    superscape

    Joined:
    Feb 12, 2008
    Location:
    East Riding of Yorkshire, UK
    #5
    Sure.

    Assuming you have some kind of web server running PHP that can accept uploads then you need to make a php file something like this:

    Code:
    <?php
    //n.b. this script is for demo purposes only is is in no way suitable for real-world use!
    
    $XFDFData = file_get_contents('php://input');
    
    //make a file name using a time stamp - not necessarily guaranteed to be unique...
    $theFileName = date("Y-m-d H-i-s").".xfdf"; 
    
    //write the received data to the file
    $fd = fopen($theFileName, "w");
    fwrite($fd, $XFDFData, strlen($XFDFData)); //write into a file
    fclose($fd);
    
    //output some kind of response
    echo "<html><body>Got it!</body></html>";
    
    ?> 
    
    
    As per my commend in the above code, that's a long way from being production ready code! It's just to show the general idea. Let's say that you save it as uploads.php.

    All you then need to do is create a submit button in your web form, and point it to your script. See my screen shot.

    Submitted xfdf should now appear in the same folder as your upload.php script, assuming permissions etc allow.

    That's the general idea, anyway.

    Note that viewers would need to download the PDF and submit it. If you want them to fill it in whilst on your web page then I'd suggest an html form would be a much better option - there are plugins that'll do that for you. I use http://contactform7.com for the support form at http://www.ghostotter.com Works fine for me.
     

    Attached Files:

  6. pwhitehead thread starter macrumors 6502

    pwhitehead

    Joined:
    Jul 19, 2011
    Location:
    new jersey
    #6
    So doing it with contactform7, the only downfall would be the information is sent over in an itemized list with just text aside from having an actual form right? The thing that I love about contactform7 is not only is it free, but it has a browse button so the person can upload files too. You're awesome, thanks so much for your help!
     
  7. superscape macrumors 6502a

    superscape

    Joined:
    Feb 12, 2008
    Location:
    East Riding of Yorkshire, UK
    #7
    Yup.

    Depending on what you want to do with the contents of the form, maybe you might be able to have some kind of AppleScript to parse out the contents of the email and do stuff with it.

    Aaaah, shucks... ;-)
     

Share This Page