How to send a document in net. HTTP.request as a POST variable?

I have read and reread the doc on the net. HTTP.request and he says I can pass an argument to oRequest, but I failed to pass in the current document, which is what I want to do.

I tried app.activeDocs [0], or the encoding of a string, but if he makes the call with no error, nothing is sent.

ORequest must be a single document, or a variable consisting of name-value pairs? How to send multiple parameters to a POSITION otherwise?

I did very well with the call using GET, but when I tried to send the document as a GET variable, I did nothing either.

I send to an end point of LiveCycle REST so either POST or GET is fine.

Thank you!

Validating the document current is simple * provided * your script runs outside the context of the document (i.e. in the console or a script to the folder level). There is no access to scripts of doc-level for obvious reasons.

For example, put this in the console JS OCCURS the current file to a URL:

Net.HTTP.request ({}

cVerb: 'POST',

cURL: "http://localhost/submit.php."

oRequest: Collab.documentToStream (this);

oHandler: {}

answer: function (msg, uri, err) {}

If (err! = undefined) app.alert (msg);

}

}

});

Your problem talking to a vanilla Web service, is that you can send the RFC1867 delimiters (i.e. the form apply for "multipart/form-data") that the ReadStream object is not a method of concatenation in the JSAPI Acrobat. It's also how you would usually precede other fields in the form, but if you are careful with your codes side server that you can send to save them as GET parameters in cURL. Normally, you'd be polite and passed a context of Type in the table of aHeaders header - it won't matter for the transmission process, but will allow your webservice predict what that heck he was sent.

Your webservice will then read the raw data. PHP for example, you will get nothing in the $_FILES global, but you can grab the PDF by reading all of the input buffer, with the line:

$pdf = file_get_contents() ("php://input");

If this line was in the server script which was the JS code above, the variable $pdf will contain an exact binary copy of the currently opened document.

Tags: Acrobat

Similar Questions

  • How to send a document archived in my library to use

    How to send a document archived in my library to use.

    Hello Tina,

    You want to use the document archived as a library template in your account E-Sign? If this is the case, then from now on, it is not possible. You must create the model directly uploading from your computer system.

    Kind regards

    -Usman

  • How to send a document by my email?

    How to send a document by my email?

    You attach it like any other file...

    Friday, August 1, 2014 at 23:00, troyboy538, [email protected]>

  • How to get AFExecuteThisScript to return the value of Net.HTTP.request (asynchronous)?

    I have an Acrobat only plugin, developed in 2005 VS.  Originally with Acrobat 7 SDK, now updated to use Acrobat 9 SDK.  The ultimate goal of this feature is to open a PDF file from a web server Agile: If a user string, a URL is created, a request sent to the URL, then pay back the answer.  The answer can be either the PDF itself or a string path to the PDF file.  I thought it would be easier to use the version of PDF path to simply open the new PDF of the http:// address.

    I created a folder level javascript with a call to Net.HTTP.request confidence.  I have a script that works when invoked from a menu item added by the folder level javascript file.  But when you use this same command in my C++ with AFExecuteThisScript code, I can't get the HTTP response to finish pending in the code for the result.

    The Net.HTTP.request and the asynchronous callbacks confuse me, so maybe that's my big problem.  I could not Net.HTTP.request to return a value in a service simple javascript right now, I'm trying to use a "global" variable in the JavaScript folder level and two calls.  The first call "sets" the global variable, the other "becomes" it.  But this seems to be the issue.  When I have my code debugging or stop execution, the part of the response of the Net.HTTP.request is never called.  But when I left to go beyond this step with error recovery, the answer appears later.

    So how kick off of the Net.HTTP.request and be notified when it's over?  either in JavaScript or VC ++?

    Any help is appreciated.  Even if the best option is to stream the file from the web server to a local file and then open the (this is the option that I take in another tool that runs outside of Acrobat).

    Here's the code.

    Javascript controls at the level of the files (urls truncated for the post)

    var THE_PATH = '';
    
    function setTHE_PATH ( gURL ) {
        console.println('setTHE_PATH Begin');
        var params =
        {
            cVerb: 'GET',
            cURL: gURL,
            oHandler: 
                {
                    response: function( msg, uri, e)
                    {
                        console.println('response method: Setting Path');
                        THE_PATH = SOAP.stringFromStream( msg );
                        console.println('<<' + THE_PATH + '>>');
                    }
                }
        };
        console.println('URL: ' + params.cURL + '\n  oHandler: ' + params.oHandler );
        console.println('Path: ' + THE_PATH );
        var netResult = trustedNetHTTPrequest(params);
        console.println('setTHE_PATH End');
        return THE_PATH;
    };
    
    trustedNetHTTPrequest = app.trustedFunction( 
        function ( params ) {
            console.println('trustedNetHTTPrequest begin');
            app.beginPriv();
            var netResult = Net.HTTP.request( params );
            app.endPriv();
            console.println('trustedNetHTTPrequest end');
            return netResult;
        }
    );
    

    Added MenuItems with JavaScript at the folder level

    app.addMenuItem( { 
        cName: "mysetTHE_PATH", 
        cUser: "set THE_PATH", cParent: "Tools", 
        cExec: "setTHE_PATH('http://......&getURL=true');",
        nPos: 0 
    } );    
    
    app.addMenuItem( { 
        cName: "mygetTHE_PATH", 
        cUser: "get THE_PATH", cParent: "Tools", 
        cExec: "console.println( THE_PATH );",
        nPos: 0 
    } );   
    

    Here's the JavaScript Console output when you run these two commands:

    setTHE_PATH Begin
    URL: http://......&getURL=true
      oHandler: [object Object]
    Path: 
    trustedNetHTTPrequest begin
    trustedNetHTTPrequest end
    setTHE_PATH End
    response method: Setting Path
    <<https://......DesiredFilename.pdf>>
    

    Here is the function in the plugin C++, with additional measures to prove AFExecuteThisScript works here

    sprintf(jsScript, "testVal='%s';event.value = testVal;", strURL.c_str() );
    AFExecuteThisScript( aPdDoc, jsScript, &pReturnValue );
    // After this, pReturnValue is the passed-in URL, as expected.
    sprintf(jsScript, "setTHE_PATH('%s');event.value = 'Step 1 Worked!!';", strURL.c_str() );
    AFExecuteThisScript( aPdDoc, jsScript, &pReturnValue );
    // After this, pReturnValue is 'Step 1 Worked!!', as expected.
    sprintf(jsScript, "event.value = THE_PATH;", strURL.c_str() );
    AFExecuteThisScript( aPdDoc, jsScript, &pReturnValue );
    // After this, pReturnValue is NULL
    

    This is the JavaScript Console output when you run the commands using the plugin (mode debugger, to wait after step 1)

    setTHE_PATH Begin
    URL: http://......&getURL=true
      oHandler: [object Object]
    Path: 
    trustedNetHTTPrequest begin
    trustedNetHTTPrequest end
    setTHE_PATH End
    

    Note that he never gets to the part of the "method of response.

    Thank you!

    Tim James

    You need not limit yourself to the plugin API. The requests HTTP from C/C++ is a fairly common condition, just observe the restrictions in my answer.

  • LiveCycle Design apply 'Rights form', Net.HTTP.request

    Hi all

    It seems that I can't use Net.HTTP.request (I use ping on our network to see if it is available or not) in my form which is read by the reader because he needs 'Form rights' applied by another piece of software, Adobe LiveCycle. https://forums.Adobe.com/thread/550113?TSTART=0

    So my question is, would I just open my existing form in LiveCycle, applicable 'rights form' and save it from here in pdf format or I have to rebuild my whole form in LiveCycle? I'm not at all familiar with the tool and try to get a trial version of it.

    I might add, while the JavaScript API Adobe mentions this method Net.HTTP.request rights to form, it of course does not explain we have LiveCycle to achieve... kind of annoying.

    Please specify.

    John

    LiveCycle Reader Extensions is part of the LiveCycle; You should contact the Sales Department of company Adobe. Install you it on a server and to do a proper API. The price is by negotiation, but wait at least 5 digits. Allow SUFFICIENT time for the approval process.

  • How to send a document in WordPad

    Brand new computer and I'm "technically challenged". Seized of a three page in WordPad document (I've never heard of) thinking that I could send as an attachment, but cannot.  Is - it somehow possible or there at - it a program I don't have will allow me to do? Thank you.

    OK, so what email you service use?

    How to attach a document:

    Google Mail... http://support.Google.com/mail/bin/answer.py?hl=en&answer=6584

    Hotmail... http://www.ehow.com/how_8765266_attach-document-Hotmail.html

    Yahoo Mail... http://answers.Yahoo.com/question/index?QID=20091220101529AAcABsY

    If you use a service other than the three listed e-mail, type the name of the e-mail service in your search box of the browser and follow up with "how to reach a document."

    If your line will look like this:

    How to attach a document by mail

  • How to send a Document echo sign with apex code in Salesforce

    I want to send the document sign echo on custom button using the apex code.

    Document has been sent but the main problem is that the mail not send with the right format, according to the standard.

    I don't have any link to sign the document.

    Please provide me with the name of the API by which we apply it

    My Code is

    public class SendAgreementDocument {}

    Public Sub SendPdf()

    {

    agmt echosign_dev1__SIGN_Agreement__c = new echosign_dev1__SIGN_Agreement__c();

    agmt. Name = "Sample agreement";

    agmt.echosign_dev1__Recipient__c = "003O000000YcB0Q"; / / Contact field

    agmt.echosign_dev1__Contract__c = "800O00000002sVx"; / / ContractID.

    agmt.echosign_dev1__Merge_Mapping__c = "a0qO0000006npqT"; Echo sign merge Mapping

    agmt.echosign_dev1__Process_Template__c = "a0kO0000003SdP2"; / / Echo sign Data Mapping

    agmt.echosign_dev1__RemindRecipient__c = "All the days, until this that signed";

    agmt.echosign_dev1__SenderSigns__c = true;

    agmt.echosign_dev1__Message__c = "Please sign the attached insertion order;

    agmt.echosign_dev1__SignatureType__c = 'Electronic Signature';

    agmt.echosign_dev1__PasswordProtectSign__c = false;

    agmt.echosign_dev1__SenderSigns__c = true;

    agmt.echosign_dev1__PasswordProtectPDF__c = false;

    agmt.echosign_dev1__SignatureOrder__c = ' signs of the recipient, and then I'll sign. "

    agmt.echosign_dev1__Status__c = "project";

    Insert the agmt;

    System.Debug (agmt);

    Annex a1 = [select ID, parentId, name, body, ContentType in attachment where Id = "00PO0000002LCId"];

    Attachment a = a1.clone ();

    a.parentId = agmt.id;

    Insert a;

    Messaging.EmailFileAttachment attach = new Messaging.EmailFileAttachment ();

    attach.setContentType (a.contentType);

    attach.setFileName (B.SID);

    attach.setInline (false);

    Fix. Body = a.Body;

    Mail Messaging.SingleEmailMessage = new Messaging.SingleEmailMessage ();

    mail.setUseSignature (false);

    mail.setToAddresses (new String [] {'[email protected]""});

    mail.setSubject ('your presentation');

    mail.setHtmlBody ("Dear customer, < br > < br > please find your declaration attached in the email.'");

    mail.setFileAttachments (new Messaging.EmailFileAttachment [] {a});

    mail.setFileAttachments (new Messaging.EmailFileAttachment [] {attach});

    Send the email

    Messaging.sendEmail (new Messaging.SingleEmailMessage [] {mail});

    }

    }

    Hello

    If you want to use the EchoSign API directly to send, then you will need to call the sendDocumentInteractive API, developing the SOAP request. Here's the documentation - https://corporate.echosign.com/public/docs/EchoSignDocumentService19?#sendDocumentInteract ive

    But it is easier to use the wrapper that we provide to join the contract, make sure that you have our application installed, the latest news from the AppExchange v15, then from your apex code invoke the global echosign_dev1. Method of sendDocument of the class EchoSignApiService, passing the Id of the record of the agreement that you have created.

    Thank you

  • How to send a document

    How can I email a document in Acrobat?

    Open the e-mail > Attach document > Send email.

  • How to send a document by mail

    Hello

    I am trying to create a document that needs to be filled in by the user and then send it to a mailbox mailbox (for further processing).

    So I created a form with some fields and a button.

    This button should do the validation of the document, and then, if it's a document valid, send it by mail to the mailbox and then close the document.

    The document must be sent to the mailbox in PDF format!

    Can someone help me to do?

    Thanks in advance,

    Kind regards

    Olivier Mahieu

    P.S.: I have already read some threads on the forum and tried to do, but without success...

    Hi Olivier,.

    Here is the form to the you: https://acrobat.com/#d=Hb8JjB * yu6HdtTvy4bFehA

    When the form is opened in Acrobat (or preview) by pressing command + J to display the Javascript Console. This showed that the full reference for PostalCode was not provided.

    Change of the switch statement to the following worked:

    switch (Page1.Table.PostalCode.rawValue)
    
    {
         ...
    

    I see you are using paper based on bar codes. These only work in Acrobat or Reader if the shape is compatible with the full server LC Reader Extensions ES product player. Reader allowing the form in Acrobat will not turn on the features of barcode.

    Good luck

    Niall

  • NET.http.Request in a document-level script

    Is - it really not possible as indicated in the documentation?

    Seems to work with a GET verb in a certified document, which is trust on the customer running Pro...

    With the help of a certified document where the user has added the signatory certificate to their list of trusted certificates is another way to allow JavaScript to run, it is simply not always explicitly mentioned in the documentation.

  • How to send a dialog box of Photoshop Elements on a post?

    I want to download some dialogue of my Photoshop Elements software to my post.  I understand that the camera icon should be clicked. And I understand the upload must be clicked at the end. But what is the procedure to access the Photoshop Elements dialog box after clicking on the camera icon?

    If using Windows 7 or Vista using the Snipping Tool in accessories.

    Drag the red outline around the part of the screen you want to capture and then save it in jpeg format. You can then download this image.

  • PDF http request

    Hello

    I'm working on Acrobat Pro

    My goal is to Send a HTTP request by my PDF file

    I took a classic example:

    I put the javascript code in programs /Acrobat/.../javascript/


    AJAX = {function (cURL)}

    var params =

    {

    cVerb: 'GET ',.

    cURL: cURL,.

    oHandler:

    {

    answer: {function (msg, uri, e, h)

    var stream = msg;

    string var = "";

    String = SOAP.stringFromStream (stream);

    App.Alert (String);

    }

    }

    };

    Net.HTTP.request (params);

    }

    app.addMenuItem ({cName: "Go PHP", cParent: "File"})

    cExec: ' ajax ("http://localhost/myPage.php" ' ");", "

    cEnable: «event.rc = (event.target!» (= null); »,

    NPO: 0

    });

    but when I go to 'File/Go PHP' Acrobat says that it is an error internal


    What is the problem?

    Thank you

    Wrap your ajax() function in a block of confidence so it does not run as part of the event target (i.e. the open document):

    AJAX = {app.trustedFunction (function (fURL)}

    app.beginPriv ();

    var params = {cVerb: 'GET', cURL: fURL, oHandler: {}}

    answer: function(msg,uri,e,h) {}

    var stream = msg;

    string var = "";

    String = SOAP.stringFromStream (stream);

    App.Alert (String) ;}}} ;

    Net.HTTP.request (params);

    app.endPriv ();

    });

    app.addMenuItem({)

    cName: "Go PHP", cParent: "file."

    cExec: 'ajax ("http://localhost/myPage.php");',

    cEnable: «event.rc = (event.target!» (= null); »,

    ({NPOS: 0});

  • How to convert a document pages in macbook air so that when I send to someone directly from my mac, they can open in their computer windows laptop?

    How to convert a document pages in macbook air so that when I send to someone directly from my mac, they can open in their computer windows laptop?

    Depends on. The receiver has Microsoft Word

    If so, open the document, and in the top menu bar, tap Share > Send a copy > Mail > Word > next... and follow the instructions.

    Hope this helps,

    -End

  • How do send you a document typed in wordpad?

    I understood how to create a document in wordpad, but not how to send by e-mail. How is that done?

    1. Save the document.
    2. Open a new message window.
    3. Attach the document.
  • How to select a file folder to send scanned documents to?

    I have a photosmart 6525.  I would like to send the documents in a folder specific file in My Documents.  How?

    You have the full recommended software installed for the Photosmart 6525? If not, click here.

    If so, then open the HP printer Assistant software installed with the printer.
    * Select analysis a Document/Photo option to open the scan window
    * Select Advanced... settings option on the right side of the screen
    * Select the Destination tab
    * In the middle of the window is a box containing the destination of the file scan. You can choose "Browse" and set the folder desired as the scan destination.
    * Click Save

    I would like to know how this happens.

Maybe you are looking for