Skip to main content
ollies74550830
Participating Frequently
April 25, 2018
Answered

Acrobat Pro DC Trying to add save button and save fillable PDF

  • April 25, 2018
  • 1 reply
  • 9548 views

Trying add a save button on fillable form to save progress on an exam. Then student can reload and continue exam.Added bonus would be the ability to save online to a predetermined folder.

This topic has been closed for replies.
Correct answer Thom Parker

Yes javascript or ajax would be my choice  Here is the JS  used to process the login form.   I am not a professional developer but know enough to clobber together some fairly decent sites. I know there is a way because at one time e was being tr and tansferred and echo $_POST['e'] was working. THNX

<script>

function emptyElement(x){

    _(x).innerHTML = "";

}

function login(){

    var e = _("email").value;   

    var p = _("password").value;

    if(e == "" || p == ""){

        _("status").innerHTML = "Fill out all of the form data";

    } else {

        _("loginbtn").style.display = "none";

        _("status").innerHTML = 'please wait ...';

        var ajax = ajaxObj("POST", "logProc.php");

        ajax.onreadystatechange = function() {

            if(ajaxReturn(ajax) == true) {

               

                if(ajax.responseText != "logged"){

                    _("status").innerHTML = 'error';

                    _("status").innerHTML = ajax.responseText;

                    _("loginbtn").style.display = "block";

                } else {

                    _("status").innerHTML = ajax.responseText;

                    window.location = "profile.php";

                }

            }

        }

        ajax.send("e="+e+"&p="+p);

    }

}

</script>  


Acrobat JavaScript has almost nothing to do with Browser JavaScript, except for the core language. So you're script above is not useful for submitting data from a PDF. Please look over the Acrobat DC SDK Documentation 

1 reply

Thom Parker
Community Expert
Community Expert
April 25, 2018

Ideally, you add a button to the PDF, select the MouseUp trigger on the properties dialog for the button, And then select "Execute a menu item" for the action. Then select the "Edit->Save" menu item.

Unfortunately this doesn't work because the Save menu item is blacklisted for form operations.

Here's an article on how it's done.

https://acrobatusers.com/tutorials/how-save-pdf-acrobat-javascript

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
ollies74550830
Participating Frequently
April 25, 2018

That did not work in Acrobat Pro DC   I have a simple login form and have tried html with all all fields to a php online.  which works with my regular login form but field data is not acessable. Also tried send to url and neither work.  I would provide files and such to troubleshoot but I know already what your answer will be Just tell that doesnt work either. And my reply will be when are they going to finish writing the software?

Thom Parker
Community Expert
Community Expert
April 25, 2018

I'm unclear what HTML and PHP have to do with saving a form from Acrobat to a local folder. The article explains exactly how to save a PDF to a local file folder, and it works perfectly.

If you want to save the PDF to a server, then that is a different question with a different answer.  Please explain in detail what is you want to do.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often