Wednesday, November 2, 2011

DocuSign Missing Form Field Data

So I have been testing out DocuSign to see if it will fit a need I have for documents to be electronically signed. I have been using the Embedded signing and I've like it so far. It took some tinkering to get the CreateEnvelopeFromTemplatesAndForms to work with an inline template but once it worked it was great.

Here is my short sample:

// Configure the envelope information
DocuSignAPI.EnvelopeInformation envelopeInfo = new DocuSignAPI.EnvelopeInformation();
envelopeInfo.AccountId = "XX";
envelopeInfo.EmailBlurb = "You sign this.";
envelopeInfo.Subject = "Please sign!";

DocuSignAPI.CompositeTemplate template = new DocuSignAPI.CompositeTemplate();

DocuSignAPI.Recipient[] signers = ConstructRecipients();

DocuSignAPI.InlineTemplate inlineTemplate = new DocuSignAPI.InlineTemplate();
inlineTemplate.Sequence = "1";
inlineTemplate.Envelope = new DocuSignAPI.Envelope();
inlineTemplate.Envelope.Recipients = signers;
inlineTemplate.Envelope.AccountId = ConfigurationManager.AppSettings["DSAPIAccountID"].ToString();

Tab tab = new Tab();
tab.DocumentID = "1";
tab.RecipientID = randomId;
tab.Type = TabTypeCode.SignHere;
tab.PageNumber = "9";
tab.AnchorTabItem = new AnchorTab();
tab.AnchorTabItem.AnchorTabString = "Person Signature Line";
tab.AnchorTabItem.Unit = UnitTypeCode.Pixels;
tab.AnchorTabItem.UnitSpecified = true;
tab.AnchorTabItem.XOffset = -10;
tab.AnchorTabItem.YOffset = -20;

inlineTemplate.Envelope.Tabs = new DocuSignAPI.Tab[] { tab };

template.InlineTemplates = new InlineTemplate[] { inlineTemplate };

// Configure the document
template.Document = new DocuSignAPI.Document();

template.Document.ID = "1";
template.Document.Name = "Document Name";

PDFGenerator generator = new PDFGenerator();
byte[] documentBytes = generator.DownloadFile();

template.Document.PDFBytes = documentBytes;

template.Document.TransformPdfFields = true;
template.Document.FileExtension = "pdf";

status = client.CreateEnvelopeFromTemplatesAndForms(envelopeInfo, new DocuSignAPI.CompositeTemplate[] { template }, true);

if (status.SentSpecified)
{
base.AddEnvelopeID(status.EnvelopeID);
// Start the first signer
SignFirst(status);
}
...

Ok. Although I could run the code, make the document show up in the iframe and have the little "Sign Here" block show up in the right spot, the BIG problem I had was my form field data that I was populating was missing when it was uploaded to DocuSign.

After hours and hours of testing, looking at my PDF's...blah blah blah..I noticed that sometimes that data did show up in a couple of my documents. And after more testing, I found that if my form fields first showed up on page 6, I was good to go. However, if they showed up on page 7, they were blank..and what good is signing off on document when the data is blank? (this was in the API and online console)

Anyhow, so I contacted DocuSign. They said this was an issue with the Chrome browser. So I tried out uploading thru the online console using IE. And sure enough that did work. So they recommended I user IE/FireFox. However when I tried again thru the API in IE/FF it was no go.

So being frustrated over this for many days, I FINALLY had a crazy thought - put a dummy field on page 4 (could be 1,2,3,4,5,or 6) but I had room on 4. I made it invisible too.

And viola...it worked! Relief...now I can move on in life. I do hope DocuSign does get that resolved though. If a difference of a single page can make or break it, I think you might have some coding problems. Hehe.

No comments:

Post a Comment