Acrobat Reader DC fails on CommandInvalidContextError when submitting PDF document to server

484 views Asked by At

We have Flex application that opens the PDF document in IFRAME and allows user to fill-in the PDF form, add signature and submit the PDF back to the server.

HTML fragment:

<object CLASSID="clsid:CA8A9780-280D-11CF-A24D-444553540000" id="myPdf" border="0" width="100%" height="100%"
    type="application/pdf"
    standby="Loading pdf..."> 
    <PARAM NAME="src" VALUE="downloadDocument.do?docId=12345">
    <p>Error Loading PDF.</p>
</object>

When user submits the PDF back to the server following JavaScript code is executed.

function submitPdf(url) {
    var params = new Array(3);
    params[0] = "Submit";
    params[1] = url;
    params[2] = "PDF";
    var ar = document.getElementById("myPdf");
    ar.messageHandler = {
        onMessage : function(msg) {
            window.alert("Success...");
        },
        onError : function(error, msg) {
            window.alert(error);
        }
    };

    ar.execCommand(params);
}

URL is the server-side handler which receives PDF data and saves it to the database. Client is already logged to the application and has valid JSESSIONID cookie.

Everything works with Acrobat Reader 10, but after installation of newest Acrobat Reader 2015 DC we get CommandInvalidContextError exception.

Does anyone know what needs to be done to get the submit action working or how to call Acrobat Reader plugin's API properly?

1

There are 1 answers

0
Ultramysak On BEST ANSWER

Try to update to the latest build of Adobe Reader DC (In application main menu -> Help -> Check for updates)

In June 2015 was released update 2015.008.20082. This continuous update provides security mitigations, and bug fixes. It's possible that your problem is related with this release notes.

I hope that this solution will be included in next major update in base installation.