I have a white-text on a white-background text box on a PDF. The text in that text box is set to "<signature>". This is the area on the PDF that I want a signer's signature to go.
Please note, this is not a TEXT FIELD, but is a TEXT BOX. They're different things in Adobe PDF. For one thing, text boxes only have text and don't have actual field names like fields do.
I don't want to specific X and Y coordinates of this textbox. I don't want to use a DocuSign template. I do want to use our pre-defined text box. I do want to define the signature area entirely using the API/SDK, associating it to my text box.
This is what I've tried:
I'm using the eSign model from the SDK. I instantiated a new DocuSign.eSign.Model.SignHere object. Do I need to associate that sign here tab somehow to my text box on the PDF? I've tried setting each of the properties seperately (like below), but did not get the result I expected. Again, I want to associate a DocuSign.eSign.Model.SignHere tab with a pre-defined textbox on my PDF called.
var SignHereTab = new DocuSign.eSign.Model.SignHere();
SignHereTab.TabId = "<signature>";
SignHereTab.Name = "<signature>";
SignHereTab.AnchorCaseSensitive = "<signature>";
SignHereTab.CustomTabId = "<signature>";
Or, am I going about this all wrong? If I can't do this with a TEXT BOX, can I do it with TEXT FIELD? If it's better to use a FIELD, what code do I use to associate a sign here tab with a field? Again, I'd rather not use X/Y or Templates.
Do I understand correctly that this is what you want to accomplish?
Use the API to create an Envelope, with the PDF you specify as the document
Have a SignHere tab automatically placed in the document based on where the string <signature> appears in the PDF
If that's the case, then you'll want to use what DocuSign refers to as anchor text -- this is a string that exists in the document as normal text (i.e.,, not within a text box, but rather, as normal text on the page). The "Get the Document to be Signed" section of this page provides a description of how to use anchor text (and even provides a sample doc that contains anchor text). An excerpt from that page:
Open Mutual_NDA.pdf in a PDF viewer. Search for the strings “signer1name”, “signer1sig”, and “signer1date”. You’ll notice that the search matches but that the text is not visible. These strings are regular text in the document. Their text color has been set to white, so they can’t be see in the document. But DocuSign can find them, and use them as anchor text to place the tabs (the signature, name, and date fields).
So, simply add the text string <signature> as white text (on white background) within your PDF. Then when specifying the SignHere tab in the "Create Envelope" API request, set the following properties for that tab:
"recipients": {
"signers": [
{
"roleName": "Signer1",
"recipientId": "1",
"name": "John Doe",
"email": "johnDoe#test.com",
"tabs": {
"signHereTabs": [
{
"anchorString": "<signature>",
"anchorIgnoreIfNotPresent": true,
"documentId": "1",
"optional": false,
"tabLabel": "Signature"
}
]
}
}
]
}
When used within a "Create Envelope" request (POST https://{{env}}.docusign.net/restapi//v2/accounts/{{accountId}}/envelopes), the JSON above will result in a (required) SignHere tab being automatically placed for recipient John Doe anywhere that the string <signature> appears in the document.
(I'm not very familiar with the node SDK, but I imagine that knowing what properties need to be set will get you going in the right direction.)
UPDATE #1
If it's important that the signature appear inside a textbox on the PDF, you can still accomplish this using anchor text. For example, simply place the anchor text string (ex: ) in the PDF just below the textbox where you want the signature tag to appear, the specify the anchorYOffset property and the anchorUnits property to tell DocuSign where you want the signature tab to appear relative to the position of the anchor string. In that example, here's the structure of the signature tab in the API request:
"signHereTabs": [
{
"anchorString": "<signature>",
"anchorXOffset": "0",
"anchorYOffset": "-10",
"anchorUnits": "pixels",
"anchorIgnoreIfNotPresent": true,
"documentId": "1",
"optional": false,
"tabLabel": "Signature"
}
]
Finally (for your reference), here's the full list of the tab properties related to anchor strings:
I'm not sure you'll be able to do this using a text box instead of text field. See this page on the REST API guide:
Document Parameters
Only the FieldTypes and FieldProperties listed below are extrapolated from the forms:
FieldTypes that are extrapolated are: CheckBox, DateTime, ListBox, Numeric, Radio, Text, Signature, and Password.
FieldProperties that are extrapolated are: ReadOnly, Required, MaxLength, Positions, and Initial Data.
There's an example of how to do the transform in the Dev Center website (you need to use composite templates) but as mentioned I think you need to use text fields for it to work. See the Transform PDF Fields section:
Transform PDF Fields
Related
Is it possible to map data to tabs in an existing envelope using tabLabels? If not, do I just need to specify the tabId to indicate which tab should be populated with my data or is there a different identifier that I should use?
Background - I've been populating tabs while creating envelopes with a template based on this process. So if I'm populating a text tab, my json looks like:
{
"textTabs": [
{
"tabLabel": "text",
"value": "Jabberwocky!"
}
]
}
I'm mapping the contents of form fields from another form building service to the tabs in my DocuSign form and since I can specify which tabs should be populated based on the tabLabel, I've mapped my form fields to tabLabels. This works fine when creating a draft envelope.
But I need to populate more tabs in my draft envelope with the contents of subsequent form submissions from separate forms. I'd like to use my existing map of form fields > tabLabels but when I try with Envelopes Update or EnvelopeRecipientTabs (I'm not sure which I need to use here), DocuSign adds new tabs to my envelope, rather than mapping my data to the existing tabs 🥲
As far as I can tell, unique tabIds are generated each time a new envelope is created. So it'd be much easier to use tabLabels, which are always the same for each envelope.
In the end I did have to use tabIds when updating recipient text, checkbox and radio tabs in a draft envelope but that's it.
As I mentioned, when populating tabs while creating an envelope I can use the tabLabel + value. When updating tabs, I can use the tabId + value.
Rather than creating a new map based on tabIds, I was able to fetch the draft envelope's recipient tabs and match them with the keys in my existing map, based on the tab's tabLabel, which remained the same after the draft envelope was created.
Examples
Text or checkbox tabs
During envelope creation:
newTab = [
'tabLabel': label,
'value': tabValue
]
Updating recipient tabs for a draft envelope:
newTab = [
'tabId': tabId,
'value': tabValue
]
Radio button tabs
During envelope creation:
radioButton = [
'selected': true,
'value': value
]
Updating recipient tabs for a draft envelope:
radioButton = [
'selected': true,
'tabId': tabId
]
Obviously radio button tabs need to be put in a group like
newTab = [
'groupName': groupName,
'radios': [radioButton]
]
You should use EnvelopeRecipientTabs like you mentioned.
Which means you need to have the recipientId for the specific recipient that the tab is associated with (every tab is part of a specific recipient).
So you build a URL like this:
PUT restapi/v2.1/accounts/{ACCOUNT_ID}/envelopes/{ENVELOPE_ID}/recipients/{RECIPIENT_ID}/tabs
Now in the body of the request you need to have the following fields:
documentId, recipientId, tabLabel, tabId, value
tabId is a unique GUID that you can find if you check your envelope (you can make a GET to the envelope and include tabs)
tabLabel must also match
I'm using the ruby_gem to pre-fill a Docusign template in embedded signing. I currently have mostly textLabels, 1 radio and a couple of checkboxes.
It just dawned on me that to proper pre-fill the values on docusign, I have to tie the docusign data model to to match Docusigns...
What I'm trying to do
signer = DocuSign_eSign::TemplateRole.new({
clientUserId: form["user_id"],
email: form["email"],
name: form["full_name"],
roleName: 'signer',
tabs: {
"textTabs" => form.map { |k, v| { "tabLabel" => k, "value" => v } },
},
})
Now what I was hoping, was that I could simply call out the tabLabel, and have the value passed along. So textTabs is obvious, for radio buttons, simply select the value passed along, and for checkboxes, my data will say true/false
However, radioButtons do not get the value, because as I can tell from the documentation, I have to add a secondary tap style, called radio_group_tabs? And I imagine it's the same story with checkboxes...which means, I have to to tie my data model to that of docusigns, or at least build some middleware to pluck radio data, and checkbox data...which really now, docusigns API is bleeding into my code like nothing else.
Is there ANY way around this? What I want seems simple. Declare the tabLabel, assign the value
radio buttons are part of a group, because their logic dictates that. You don't want someone to be able to pick more than one, but how do you know which ones they can or cannot pitck?
Checkboxes are not like that, but their value is not what you are looking for, you need to either have them checked or not.
So, no, if you're looking for DocuSign object model to be like that of HTML DOM, it's not the case, you do have to work out the differences.
My application has workflow that defines all of the content needed to sign a document on the DocuSign platform aside from signatures. I'm using a parameter in my text tabs to ensure that values can only be edited within my application and workflow:
tabs: {
textTabs: [
{
name: 'Name',
tabLabel: '\\*Label',
value: 'foo',
locked: true
}
]
}
When the value of the tab has no content provided, it becomes an editable field on the platform during signing; is there a way to prohibit modification of a tab entirely? It is my preference that only signatures can be provided and the remainder of the document is left uneditable.
Some options:
If the text tab is blank, and you do not want a recipient to enter information into the tab do not include it when creating your envelope
You can specify the locked=true property. The tab itself will not be visible to a signer if it is locked=true and empty.
I am trying to understand if it would be possible to display the "Envelope ID" generated on the final PDF to be displayed in the bottom corner of the page instead of top corner.
The issue i am facing it the display is cutting of the LOGO of the page.
Any reference would be greatly appreciated!!!
It's not possible to control the placement (location) of the Envelope ID stamp that DocuSign automatically places on the documents -- but you can disable (remove) it altogether. See the answer in this post for information on how that's done: DocuSign REST API Remove EnvelopeID from PDF.
Once you disable DocuSign's auto-stamping of the Envelope ID, you can use the Envelope ID tab to place the Envelope ID whereever you want it to appear in the Envelope. Simply specify the Envelope ID tabs as part of your Create Envelope request:
"envelopeIdTabs": [{
"anchorString": null,
"anchorXOffset": null,
"anchorYOffset": null,
"anchorIgnoreIfNotPresent": null,
"anchorUnits": null,
"documentId": "#",
"pageNumber": "#",
"xPosition": "#",
"yPosition": "#",
"tabLabel": "Envelope ID,
}]
See page 352 of the REST API guide (https://10226ec94e53f4ca538f-0035e62ac0d194a46695a3b225d72cc8.ssl.cf2.rackcdn.com/rest-api-guide-v2.pdf) for details about the Envelope ID tab type.
I have radio groups set up in my template and I want to pre-fill these tags using the REST API.
Please don't ask for code and/or request/response dumps. I don't have any code to show and I am asking for this because it is not documented. I want to know what sort of JSON I need to be producing so this is really not about my code or programming language.
(Anything below this line is half rant and half describes my failed attempts at finding the documentation for this feature. It might still be useful if somebody else has the exact same problem with me.)
Here is the documentation for the API I am trying to use. There is an example for textTabs but radioGroupTabs is not even mentioned here. It is mentioned here but I can't make much out of the "null", obviously I should be sending something other than null.
Moving on, the only useful information I can find on the radio groups is about how to create them in a template, it's here. This page also doesn't mention anything about pre-filling the values for a recipient. But it's linked from here (see tabs) anyway. There is a bit of information here:
value: if an X, this is the selected radio button. Only one radio button in a group can be selected.
And then just before this it says:
selected: Sets if this is radio button is selected. Use true/false to show the value is selected or not. Only one radio button can be true.
So we learn there are only just two ways to specify a radio widget selected. Of course this applies when you are creating the widget.
Nevertheless I tried to make requests assuming this would also work for pre-filling I got this helpful error message:
{
"errorCode": "UNSPECIFIED_ERROR",
"message": "Object reference not set to an instance of an object."
}
When I search the support forum I've found this, it's not exactly the same with my problem, I'd be happy to be able to set the wrong radio widget selected (as opposed to getting the UNSPECIFIED_ERROR) but this post is about the XML API.
I started my frantical search for the new topic button, it is so well placed you can usually find it in less than 10 minutes. I remember I used to go to my profile and then click something there... Then I did what every rational developer would do in the first place and went back to the post URL and read the breadcrumbs; Dev Zone section was renamed as Dev Zone (MOVED TO STACK OVERFLOW - Use tag DocuSignAPI). So here I am.
Could anyone please tell where this feature is documented or maybe provide a sample JSON please?
You've found the correct page for how to create radio buttons, not sure why you're having trouble using that resource. You've mentioned that's the code to CREATE the radio button tabs and not send them. That's not correct - the request body to send them is the same exact body only that the status property of the request changes from created to sent.
I just tested sending two radio buttons with the first button selected by default and it worked fine for me. Here is the full request body I used for my document signature request, this should work for you as well:
{
"emailBlurb": "Testing DocuSign radio buttons",
"emailSubject": "Custom PHP script",
"status": "sent",
"documents": [
{
"documentId": "1",
"name": "test.pdf"
}
],
"recipients": {
"signers": [
{
"email": "john.doe#docusign.com",
"name": "John Doe",
"recipientId": "1",
"tabs": {
"signHereTabs": [
{
"xPosition": "100",
"yPosition": "200",
"documentId": "1",
"pageNumber": "1"
}
],
"radioGroupTabs": [
{
"documentId": "1",
"groupName": "RadioGroup1",
"radios": [
{
"pageNumber": "1",
"selected": "true",
"value": "X",
"xPosition": "300",
"yPosition": "75"
},
{
"pageNumber": "1",
"selected": "false",
"xPosition": "350",
"yPosition": "75"
}
]
}
]
}
}
]
}
}
To add to this, the above example uses absolute positioning to position the radio buttons on the document. The other way of specifying tab locations in DocuSign is by using what's called "Anchor Tagging". With anchor tagging, instead of positioning based on coordinate systems, you can you can position your tabs with respect to document content. Please see the following two links to learn how to use anchor tagging, it's quite easy to switch to this method:
Anchor Tagging Introduction - Look at the "Tab Positioning" section
Related Stack Overflow Link