wing2k5
wing2k5

Reputation: 20

DocuSign Connect - Uploaded DOCX, Returned DOCX

I have been working on a listener application for receiving HTTP POST requests from DocuSign Connect. It is coded as a ASP.NET MVC4 web application.

By using the sandbox environment, I have been able to send and receive documents in a variety of different file formats with the expected behavior outlined by DocuSign...except for docx types.

The scenario I am encountering is as follows:

  1. Attach and send a test docx file for signing via the "send envelope" interface in the sandbox environment (for simplicity, I am just adding a signature overlay).
  2. Logged into the recipient email account and go through the steps of signing the document.
  3. Wait a few minutes for the listener application to respond and extract the signed document from the XML.
  4. Verified that the filename of the extracted signed document is not a PDF, but the same as the uploaded file (name and file extension). Attempting to open it in Word results in Word complaining that the file is corrupted and cannot be opened.
  5. When checking for the same signed document (as an attachment) in the "completed" email notification, I see it as a PDF and was able to open it with no issues.

My question is why is DocuSign Connect not returning a signed PDF version of the docx file that was sent?

DocuSign's documentation has indicated that signed versions of any file format will be in PDF. As verification, I had tried using doc and jpg files with no issues.

What makes this even more strange is that if I manually change the file extension of the signed document to PDF, I can view the contents of the file as expected. So is it just a case of an incorrect file extension being returned back? Or is there a step or two that I am missing?

I have attached the XML from a couple of requests from DocuSign Connect. One is correct with no issues; and one that is problematic.

Correct XML from DocuSign Connect (Files Sent: 1 PDF, 1 doc)

Problematic XML from DocSign Connect (Files Sent: 1 docx)

If anyone knows why this is happening, I would appreciate any help I can get. It's not a deal-breaker that this is happening, as I can program in an exception to rename the file extension for docx files. It is just a minor annoyance that it has to be done.

Upvotes: 0

Views: 759

Answers (1)

Larry K
Larry K

Reputation: 49104

Regarding:

My question is why is DocuSign Connect not returning a signed PDF version of the docx file that was sent?

DocuSign did return a PDF document to you. Your conclusion that the file was not a PDF file is not correct.

The filename field is just informational, the file extension in the filename field is also not significant.

What is significant:

  • DocuSign needs to know the file type of the input / uploaded files. It uses the fileExtension field to learn from the submittor what the filetype is.
  • If the file type is anything other than pdf, it will always be converted to pdf. There are no exceptions.
  • If the file type is pdf, the pdf file will be "flattened" (rasterized) to ensure that no malware within the pdf can harm a signer or other recipient. (PDF files are actually programs. The programs usually just produce a printed page, but they can do far more, both for good and for evil. But I digress.)
  • If you choose to have the webhook system (Connect or eventNotifications) send you files, those files will always be in pdf format.
  • The fileExtension field is referring to the file type that was sent to DocuSign. The correct file extension for a file downloaded from DocuSign is always .pdf.

In your case, I opened your "problematic" XML notification message and copied the PDFBytes content to an online base64 decoder. I then opened the output using a pdf viewer and was shown your signed document.

It doesn't matter what the "name" of the document is/was. Output from DocuSign is always in the form of a PDF document.

Upvotes: 3

Related Questions