-->

Getting PDF_VALIDATION_FAILED exception when tryin

2019-07-25 09:27发布

问题:

I am trying to run the code available on GitHub.

Issue is when I am trying to create an envelope I am getting an exception saying "PDF_VALIDATION_FAILED".

Can anyone help me out with this issue?

回答1:

Really you should be creating a new issue to log the new error you are getting, or modify your original post. In any case the issue is most likely due to the file extension, the default is pdf so if you want to send a different format document you can do the following:

// Add a document to the envelope
Document doc = new Document();
doc.DocumentBase64 = System.Convert.ToBase64String(fileBytes);
doc.Name = Path.GetFileName("/PATH/TO/DOC/TEST.DOCX");
doc.DocumentId = "1";
doc.FileExtension = "docx";


回答2:

I managed to get a fix for this one. Apparently the file I was uploading was a corrupt file. However, not I am getting a different error 'UNABLE_TO_LOAD_DOCUMENT' when I try to upload a file in any format other than pdf.

Can anyone help me with this query? Also, what all file formats does DocuSign support?

Also, one of the previous libraries 'DocuSign.Integrations.Client' seem to work fine with word document uploads. Should they be used instead of 'DocuSign.eSign.Api', 'DocuSign.eSign.Client' and 'DocuSign.eSign.Model'?



回答3:

This is in response to the second error you mentioned:

I think you are missing assigning the FileExtension to the required format something like : doc.FileExtension = "docx"

Once you do that, you will get rid of UNABLE_TO_LOAD_DOCUMENT error and the document can be sent successfully.



标签: docusignapi