function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ron CarlsonRon Carlson 

Calling Adobe Sign Service from VF page

Hello,
   I am looking for some JavaScript code samples for calling the Adobe Sign Service with a button on a VF page.  I want the user to be able to preview and sign a document without using email.  Can you provide code samples of how I can make this work?

Thank you!
Ryan GreeneRyan Greene
You should not use JavaScript for this. I do exactly what you are asking using an Apex Controller/Method and VF Page which creates the PDF for signatures. The Method below is imbedded in my controller for the VF Page. Part of the answer you're looking for is the line 'agreementRec.echosign_dev1__Enable_Hosted_Signing__c = true;' this will allow the user to immediately view and sign the AdobeSign doc.
public pageReference SendPdf2(){
        //Tells the VF Page Proposal where to access the Lead information. Then sets the body of the pdf for later use
        pageReference pdfPage = Page.Proposal;
        pdfPage.getParameters().put('Id',getid);
        blob pdfBody;
        if(Test.isRunningTest()){
            pdfBody = blob.valueOf('Unit.Test');
        }else{
            pdfBody = pdfPage.getContentAsPDF();}
        //Creates the AdobeSign Agreement
        echosign_dev1__SIGN_Agreement__c agreementRec = new echosign_dev1__SIGN_Agreement__c();
        agreementRec.Name                                    = 'Name';
        agreementRec.echosign_dev1__Signaturetype__c         = 'e-Signature';
        agreementRec.echosign_dev1__Recipient_Lead__c		 = led[0].Id;
        agreementRec.echosign_dev1__Enable_Hosted_Signing__c = true;
        insert agreementRec;
        //Creates the attachment pdf for the Agreement
        attachment pdfFile = new attachment();
        pdfFile.isPrivate  = false;
        pdfFile.body       = pdfBody;
        pdfFile.parentId   = agreementRec.id;
        pdfFile.Name       = 'Name'+'.pdf';
        insert pdfFile;
        //Redirects the user to the Adobe Sign Agreement screen so they can preview and send immediately if needed
        PageReference pageref = new PageReference('/' + agreementRec.id);
        pageref.setRedirect(false);
        return pageref;