1

I am trying to e-sign with docusign on fillable pdf, but when I fill form of pdf and then sending it to docusign using docusign_rest gem, it is showing unfillable pdf.

So what I want to achieve is to save the fillable pdf with the data that the user has provided on the run time.

Is there a way to save and sign the fillable pdf online without downloading it either via DocuSign or some other utility?

Ergin
  • 9,254
  • 1
  • 19
  • 28

1 Answers1

0

Alright I did a couple of tests for you. #1 I just used the DocuSign web app and uploaded the PDF that had a filled data field. In that case you get the data in the field and the field converted as "SecureFields" and the data was there.

To preserve the fields on the PDF you need to treat the PDF as a template. Here is the JSON (sparing you of PDF bytes) to get the fillable PDF going. I have not tried it myself yet so not 100% sure if it will work for you.

In terms of how the ruby gem works I suggest you contact the author to make sure things get passed to DocuSign API in the proper format.

Use case: A user would like to create an envelope from a document that contains PDF Form Fields that they would like transformed to DocuSign Tabs.

--------------------------------------------------------------
POST http://localhost/restapi/v2/accounts/1173/envelopes
X-DocuSign-Authentication: <DocuSignCredentials><Username>.....</Username><Password>password</Password><IntegratorKey>DOCU-......</IntegratorKey></DocuSignCredentials]]>
Accept: application/json
Content-Type: multipart/form-data; boundary=AAA

--AAA
Content-Type: application/json
Content-Disposition: form-data

{
  "compositeTemplates": [
    {
      "inlineTemplates": [
        {
          "sequence": 1,
          "recipients": {
            "signers": [
              {
                "email": "tester@tester.com",
                "name": "Joe Doe",
                "recipientId": "1",
                "defaultRecipient": true
              }
            ]
          }
        }
      ],
      "document": {
        "documentId": 1,
        "name": "ElectronicPaymentAuth.pdf",
        "transformPdfFields": true
      }
    }
  ]
}

--AAA
Content-Type: application/pdf
Content-Disposition: file; filename="ElectronicPaymentAuth.pdf"; documentid=1

<DOCUMENT BYTES OMITTED>

--AAA--

Exact log of the call with PDF bytes is here: https://docs.google.com/file/d/0B32XZbrBkDXxRXNMN2trRXRVZFE/edit?usp=sharing

mikebz
  • 3,277
  • 8
  • 37
  • 50
  • I am trying on http://iodocs.docusign.com/?version=v2. I am creating Composite template by specifying 'transformPdfFields: true' and then I generate url from get_recipient_view method, I am using that url in my iframe but pdf is not fillable – user2593706 Jul 22 '13 at 05:16
  • According to the post above and the other documentation, the way to generate a url for a pdf document which would be fillable is
  • 1. Generate an envelope id for composite templates using /accounts/{accountId}/envelopes ( Send an envelope from a template with tranformPdfFields=true)
  • 2. Use this envelope id to generate url for the recipient's view for embedded sign using the call v2/accounts/:accountId/envelopes/:envelopeId/views/recipient
  • 3.The url thus generated would be a url to start the signing process and the document displayed will have fillable fields.
  • – user2593706 Jul 22 '13 at 23:22
  • Thus the fields of the fillable pdf document specified in Step 1 will be converted into Docusign SecureFields on their own and the user can fill them before signing. But,the url generated through this process is the same as for a normal request which does NOT allow to enter any data on the pdf. According to the REST documentation here [link]http://www.docusign.com/p/APIGuide/Content/Sending%20Group/CreateEnvelopeFromTemplatesAndForms.htm the for CreateEnvelopeFromTemplatesAndForms is different from CreateEnvelopeFromTemplate in that DocuSign SecureFields are extrapolated from the form itself. – user2593706 Jul 22 '13 at 23:23
  • Instead of having to define the fields on a Template in advance, they can be derived from the form on the fly.This seems to imply that for a document that requires to transform the pdf fields, a mapping is first required of the template fields to docusign secure fields. However, we could not find any such input parameters either in the Interactive tool that shows the REST API or any other forum. The CreateEnvelopeFromTemplatesAndForms seems to be a .NET and PHP only method as the link above has no corresponding REST url. – user2593706 Jul 22 '13 at 23:24
  • It would be great if someone could point out what we are missing or let us know the exact API call to make to import a template with form fields that are completed by the signer retaining the user's data (similar to what docusign allows on it's website when the following message comes : Form Fields have been detected on your document. Would you like to convert them to DocuSign Securefields) – user2593706 Jul 22 '13 at 23:25
  • actually I didn't see IOdocs supporting those exact parameters. I would just go with the raw JSON that I gave you. I had an engineer try it and I am attaching the exact log with bytes for IRS's form 4506t – mikebz Jul 23 '13 at 06:00
  • 1
    Thanks much for your response. This has helped us to get it working. What we noticed as different in this JSON from the DocuSign API is the requirement of template id. The API for /accounts/{accountId}/envelopes states that template id IS required, whereas the code you have provided us does not have it . And we tried the code you have given for this REST API call and it works perfectly for us. Not sure if the API is outdated or perhaps this in composite templates this is actually not required. In any case, thanks! – user2593706 Jul 23 '13 at 15:48