Embed Signature Box in Document with PHP

Hi,

I’m using php sdk with cloud api and I would like the user to place the signature box freely where they like. Not predetermined x and y coordinates. Your demo cloud api give the impression that you can do this and I purchased your service with this intention. Why can’t we do this using this application?

Hello,

Thank you for your request. Yes it’s possible, to do that you should use such URL for the embedding https://apps.groupdocs.com/signature2/documents/signembed/{file GUID}. In that case you will have one signature field in your document and this signature field will be movable.

If you will have more questions please feel free to contact us.

Hi,

Thanks for the response, but we have a few more questions on how we can implement this.

  1. Creating an envelope sends users emails/notifications with signing.
    Will this do that as well? It seems that I can just point this URL at any doc and it will put a signature field on it but with this, groupdocs will not know who I am when I’m signing or what user to email. This is potentially a large barrier to implementing this. We need to know what user it belongs to and we won’t know that.

  2. What about the esignature callback function? I have to pass this callback URL into the API when I create the envelope. After the envelope is created and document signed I get a callback from the API to that URL where I can mark the doc as signed in our database as well as get a signed copy of the doc. With the API endpoint Pavel just recommended, I can’t pass in who the signers are, I can’t pass in a callback function. We just show that signature field on a doc and then it’s over, we have no idea who signed it, where the signed version is etc.

Hi,

Do you have an update on this? Thanks

Hello,

Thank you for coming back. We will reply on your questions in order that you ask them.

1 When the signer tries to sign the document, he will be asked for the information and he can’t continue without filling that information. Since that you will get all info about signer.

2 The signing document functionality do not support callback notifications. The idea of signing document interface is to provide easy and quick way for signing single document without additional complications. if you need it, we can extend the API to support callback notifications from document signing for sure

If you will have more questions please feel free to contact us.

Hi,

TheWriteCRM.com is software as a service website for the writing industry. We provide many services for our users including CRM, project management, document management and much more. Several months ago we decided to use the GroupDocs API to help us add some really cool features with user’s documents. We implemented esignature using the esignature process by way of your php examples that are located here: http://groupdocs-php-samples.herokuapp.com/. In these examples it clearly instructs the user to create an envelope and pass in a callback URL, and add a signature field to the document with x and y coordinates.

It’s great that you now have an API endpoint URL now that is so easy to use ( https://apps.groupdocs.com/signature2/documents/signembed/{file GUID} ).

However we can’t implement this on our site just yet. In order for GroupDocs API esignature to work for thewritecrm.com the following must happen:

  1. Users must be able to sign a document or send a document to others for signing. On our site its not always going to be the logged on user who will be signing the doc. Sometimes I have a document that I would like to send to someone else for signing.

  2. Users must be able to sign the document on the signature line that is provided in the contents of that document. Because users will be uploading their own documents we won’t know anything about the document they want to sign. This is why dragging the signature box into place is so important.

  3. We must have a callback function from the signing process so we can get vital data such as signing status and a copy of the PDF file that is generated from the signing (the signed doc with groupdocs seal).

Rather than extending the API to add callback function to the endpoint you recommeded ( https://apps.groupdocs.com/signature2/documents/signembed/{file GUID} ) why not extend the api to add a draggable signature field onto a doc when creating an envelope (as this is what we have already implemented).

As of now we have implemented esignature where we add signature box this way:

try {
$signFieldEnvelopSettings = new SignatureEnvelopeFieldSettingsInfo();
$signFieldEnvelopSettings->locationX = "0.15";
$signFieldEnvelopSettings->locationY = "0.93";
$signFieldEnvelopSettings->locationWidth = "150";
$signFieldEnvelopSettings->locationHeight = "50";
$signFieldEnvelopSettings->name = "test" . rand(0, 500);
$signFieldEnvelopSettings->forceNewField = true;
$signFieldEnvelopSettings->page = $pageCount;
$addEnvelopField = $signature->AddSignatureEnvelopeField($this->clientId, $envelop->result->envelope->id, $getDocuments->result->documents[0]->documentId, $getRecipient->result->recipients[$i]->id, "0545e589fb3e27c9bb7a1f59d0e3fcb9", $signFieldEnvelopSettings);
$recipients[] = $recip; //add the recipient object to recipients array

} catch (Exception $e) {
$error = 'getDocument->status does not equal ok ERROR: ' . $e->getMessage() . "\n";
$this->logErrorDB($error); //DEBUG log error in db
}

It would be best if you could extend your API so I could create a signature box that is draggable without having to change all the work, time and money that have been spent implementing this esignature feature on our site.

My preference would be something like this added to the create envelope and signature process:

try {
$signFieldEnvelopSettings = new SignatureEnvelopeFieldSettingsInfo();
$signFieldEnvelopSettings->draggable = true;
$signFieldEnvelopSettings->locationWidth = "150";
$signFieldEnvelopSettings->locationHeight = "50";
$signFieldEnvelopSettings->name = "test" . rand(0, 500);
$signFieldEnvelopSettings->forceNewField = true;
$signFieldEnvelopSettings->page = $pageCount;
$addEnvelopField = $signature->AddSignatureEnvelopeField($this->clientId, $envelop->result->envelope->id, $getDocuments->result->documents[0]->documentId, $getRecipient->result->recipients[$i]->id, "0545e589fb3e27c9bb7a1f59d0e3fcb9", $signFieldEnvelopSettings);
$recipients[] = $recip; //add the recipient object to recipients array

} catch (Exception $e) {
$error = 'getDocument->status does not equal ok ERROR: ' . $e->getMessage() . "\n";
$this->logErrorDB($error); //DEBUG log error in db
}

The last concern that we have is that if you provide a new SDK will the other features in the SDK still be backwards compatible? It seems like you have a new version of the SDK that was committed 12 days ago. (groupdocs cloud SDKs). Because of the large time and money investment of developing around your API and SDK we can’t afford to upgrade to the newest version of the SDK each time there is a new version if there isn’t backwards compatibility for other features.

Hello,

Thank you for detailed usecase . We discussed with our core developers extending of the api - adding of draggable signature field onto a doc when creating an envelope. We have a good news for you, we will add such functionality in the next release of the API. Please stay tuned and check new release for this feature.

As for updating SDK – Basically there is no issues with the update. We doing all to avoid any situations when the old feature will be changed in the new version. Even if we do any changes in the old functions – these changes are minor and not important. Such changes are always showed in the samples and documentation.

If you will have more questions please feel free to contact us.

Hello,

That’s great News! We plan to launch our new service in October, but of course we want to prepare and test before. Do you have a time frame for this function release in the API?

Pavel,

We really need to know if this feature has been taken care of. I have added new version of SDK from groupdocs-php on github to my site. I need to know how to use the new draggable signature field in envelope creation signature api.

I suggested a feature like this:

try {

$signFieldEnvelopSettings = new SignatureEnvelopeFieldSettingsInfo();
$signFieldEnvelopSettings->draggable = true;
$signFieldEnvelopSettings->locationWidth = “150”;
$signFieldEnvelopSettings->locationHeight = “50”;
$signFieldEnvelopSettings->name = “test” . rand(0, 500);
$signFieldEnvelopSettings->forceNewField = true;
$signFieldEnvelopSettings->page = $pageCount;

And you replied on September 21, 2014 saying that you were going to add this feature to API after speaking with core developers and that this feature would be available in new version of API. My question is now that I have new SDK in use on my site how do I access/use this feature. Just like I suggested above? I just need to know the right way to tell the API to make the signature field draggable.

Hello,

Thank you for coming back. The release will be in a couple of weeks.

If you will have more questions please feel free to contact us.

Hello,

Thank you for coming back. Yes we have added such functionality. Please use

$signFieldEnvelopSettings = new SignatureEnvelopeFieldSettingsInfo();
$signFieldEnvelopSettings->lockDuringSign = false;

for manipulating this option.

If you will have more questions please feel free to contact us.

Hi,

Checking on this feature to see when it will be available? I noticed in your newsletter that it will be coming soon. Thanks

Hi,

Has the signature placement box as described in my user case been released?

Thanks this worked but now I have a couple of questions. Upload() from the storage api has now broken all over my site and I get this exception: Missing argument 6 for StorageApi::Upload(). My questions is when has Upload() ever had 6 arguments? Did this change?

Pavel,

I have a follow up question here about the placing of signature boxes on documents during esign. We are using the new feature that you added:

$signFieldEnvelopSettings = new SignatureEnvelopeFieldSettingsInfo();
$signFieldEnvelopSettings->lockDuringSign = false;

We are placing the envelope in a location below like this:

$signFieldEnvelopSettings->locationX = “0.15”;
$signFieldEnvelopSettings->locationY = “0.93”;

After the initial api calls have been made and we load the esignature document viewer in an iframe for the user to sign, I can see the esignature field loaded on the page at the x and y coords that we specified above. This is shown in the attached image: Screen Shot 2015-01-26 at 2.22.25 PM.png.

Then I dragged the field up and over to the right and added my signature. This is shown in the attached image: Screen Shot 2015-01-26 at 2.22.48 PM.png.

After I had successfully signed the document, my code calls your api to retrieve and display a copy of the signed document and the signature is not on the document in the place where I had moved my signature field. It seems to be at the location of the original x and y coordinates. This is shown in the attached image: Screen Shot 2015-01-26 at 2.23.20 PM.png.

Please advise.

Hello,

Thank you for your request. Yes, upload method has changed. The “overrideMode” int. parameter has been added as 5-th parameter. Please set this parameter before file stream. You can use next values for it: 0 = Override, 1 = Rename, 2 = Break, 3 = Skip
For example: Upload($clientID, $folderPath . $name, ‘uploaded’, $callbackUrl, 0, $fs);

If you will have more questions please feel free to contact us.

Also, the envelope ID is 934ebfeedbee80732cedfce48b6c1a91

Thanks Pavel I am now able to drag the signature box around.

But I have another question…

The signature that appears on the signed version of the document doesn’t appear in the spot where I dragged the envelope to.

Hello,

We are sorry to hear that you have such issue. We have reproduced the issue and our core developers will fix it soon. We will notify you when it will be ready.

Sorry again for the inconvenience.

Hello,

Thank you for your request. Could you please share with us the envelop GUID that we can test it and add a screenshot of the signature field position before and after signing.