How set the location of Signature placeholder in adobe echosign document

3.6k Views Asked by At

I am implementing echosign api on a website.

I have downloaded the php script from

https://github.com/craigballinger/echosign-api-php

I want embedded widget for my website. I have implemented this widget.

Now in my case we generate the document dynamically for every order. It is PDF and may be from 3 to 6 page according to plan.

Now I want to know how to put signature placeholder at specific location of a dynamic doc.

Before this I was using docusign in which i have to specify X Y coordinates to specify the location of signature placeholder on the document.

Please help.

3

There are 3 best solutions below

0
On

Hi I am in the same situation. I still can't add custom fields using API.

This is my code:

$fields_array = array(
    "fileInfos" => array([
        "transientDocumentId" => $transientDocumentId
    ]),
    "name" => "PDF testing",
    "participantSetsInfo" => array([
        "memberInfos" => array([
            "email" => "[email protected]"
        ]),
        "order" => 1,
        "role" => "SIGNER"
    ]),
    "mergeFieldInfo" => array([
          "defaultValue" => "Test",
          "fieldName" => "sigBlock2"
    ]),
    "signatureType" => "ESIGN",
    "state" => "DRAFT" //<-- if I use AUTHORING i can't assign custom fields
);


$postdata = json_encode($fields_array);

$resource = curl_init();

curl_setopt_array($resource, array(
  CURLOPT_URL => "https://api.eu1.echosign.com/api/rest/v6/agreements",
  CURLOPT_HTTPHEADER => $header, //<---contain token etc....
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => $postdata,
  CURLOPT_SSL_VERIFYHOST => false,
  CURLOPT_SSL_VERIFYPEER => false
));

$res = curl_exec($resource);

$result = json_decode($res,true);

$id = $result['id'];

Then set custom fields:

$fields_array = array(
    "fields" => [array(
        "locations" => [array(
            "height" => 36,
            "left" => 75,
            "pageNumber" => 2,
            "top" => 200,
            "width" => 150
        )],
        "contentType" => "DATA",
        "name" => "sigBlock1",
        "backgroundColor" => "#CCCCCC",
        "inputType" => "TEXT_FIELD",
        "required" => true,
        "visible" => true
    )]

);

$postdata = json_encode($fields_array);

$resource = curl_init();

curl_setopt_array($resource, array(
  CURLOPT_URL => "https://api.eu1.echosign.com/api/rest/v6/agreements/" . $id . "/formFields",
  CURLOPT_HTTPHEADER => $header,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => $postdata,
  CURLOPT_SSL_VERIFYHOST => false,
  CURLOPT_SSL_VERIFYPEER => false
));

$res = curl_exec($resource);

Then change status to IN_PROGRESS to send email:

$fields_array = array(
    "state" => "IN_PROCESS"
);

$postdata = json_encode($fields_array);

$resource = curl_init();

curl_setopt_array($resource, array(
  CURLOPT_URL => "https://api.eu1.echosign.com/api/rest/v6/agreements/" . $id . "/state",
  CURLOPT_HTTPHEADER => $header,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => $postdata,
  CURLOPT_SSL_VERIFYHOST => false,
  CURLOPT_SSL_VERIFYPEER => false
));

$res = curl_exec($resource);

So i get email with link to sign the document....but i don't see my custom field! I always see default sign field appended at the end of document.

Where I wrong?

0
On

you can use form field layer template that is predefined form fields locations that can be applied to the document. for more info look at the parameter formFieldLayerTemplates

https://secure.echosign.com/public/docs/EchoSignDocumentService17#DocumentCreationInfo

4
On

You cannot programmatically set the location of the signature fields using X,Y coordinates like DocuSign. I had the same issue and emailed EchoSign, and they told me instead that the you have to use Text Tags for the field names.

Documentiation: http://secure.echosign.com/doc/TextFormsTutorial.pdf

So for example, to place a signature field into a document, name the field {{_es_:signer:signature}} and EchoSign will replace it with a signature field.

Of note, if you don't place these into the document, EchoSign will automatically append a signature field to the end of your document.