4

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.

user1109194
  • 41
  • 1
  • 4

3 Answers3

2

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.

Mike P.
  • 1,920
  • 1
  • 18
  • 20
  • How do you put these text tags? As text fields in acrobat pro with the given variable name? – Gustavo Rubio Sep 20 '14 at 00:08
  • How would I declare this `{{_es_:signer:signature}}` in PHP? because I need either one text field to be initial or the other depending on a variable. – Robert de Jonge Oct 29 '14 at 19:20
  • @RobertdeJonge You can't, it has to be in the PDF and you cannot declare it programmatically. So unless you're generating the PDF dynamically when requested, you'd have to have 2 versions of the PDF and serve up one or the other. – Mike P. Oct 29 '14 at 22:23
  • Ok, thanks anyway @MikeP. I had a suspicion I'd have to do something like that, but was worth asking anyway :P – Robert de Jonge Oct 30 '14 at 15:48
0

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

David
  • 1
0

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" => "myemail@test.com"
        ]),
        "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?

Giuseppe Lodi Rizzini
  • 1,045
  • 11
  • 33