-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Download document pdfs is opening with error. #305
Comments
what do you pass for documentId? |
@InbarGazit looking for your valuable inputs. |
@InbarGazit Would like to chime in that we're also getting this error, although we retrieve our documents slightly differently than Abhinav mentioned.
Interestingly, the completed envelope can be readily downloaded from the eSignature Web App, so it's certainly stored as a valid PDF somewhere! |
Quick follow-on, the example using Example:
|
Possible SOLUTION, it looks like the logic for this SDK to run This looks to predate y'all's My guess is that at least some, if not all of the odd behavior is originating from the usage of a string to store the byte chunks rather than an array like in the most modern official implementation from https://github.com/visionmedia/superagent/blob/master/src/node/parsers/image.js compared to the following from this library's ApiClient.js
Since I'm guessing upgrading from v3.8.2 of SuperAgent to the most recent of v8.0.0 would be an endeavor, I'd yoink their function from |
Because I don't leave well enough alone, yeah my above suggestion fixes it. There's 35 bytes different between using |
This commit corresponds to docusign#305 and provides a fix in line with the suggestions made therein.
This commit corresponds to docusign#305 and provides a fix in line with the suggestions made therein.
See code in https://github.com/docusign/code-examples-node/blob/master/lib/eSignature/examples/envelopeGetDoc.js which work ok for me. |
|
@InbarGazit the only part of that example we care about is the
without issue. The problem is when you write those result bytes to a "PDF" file, no PDF reader can open them. The file is corrupt. We don't use a mimeType for anything so the code from the comment a few minutes ago doesn't help us. I did most of the analysis for you all and even made an MR with the fix, which I tested locally and it does in fact fix the corrupt PDF issue. |
Also opened a support Case in the DocuSign Support site to get more visibility into the issue because it's going to be a major blocker for us that I'd rather not have to come up with a workaround for. Case #: 10013266 |
Thanks andercs. We are also having the same exact problem. The response return by getDocument looks like PDF, but it won't open. Also recently, the API seems to act up when I set documentId to be certificate it doesn't download certificate, but a invalid PDF. When download portfolio then it downloads the certificate. This just happened right before I post this. Docusign do you guys have a fix for this. Not being able to get the PDF properly via API is huge issue for using your service. |
@zero245 yeah so they blew me off completely. The support case has been closed and they refused to leave it open until it was actually fixed. In addition, I was informed they only do twice yearly releases on the SDKs, so there's no intention of doing anything until at least the next one (whenever that happens to be). With all that being said, they straight up told me to implement a workaround and query their API directly instead of using their SDK (which we did), but all-in-all it was a terrible experience and we plan to move to a competitor in the near future. |
Have you tried adding the following 2 header values:
Adding the above header values should look similar to something like this:
|
@ahmed-shorim-DS looking at the code from this SDK (specifically EnvelopeApi.js) it would appear that For our workaround that calls the DocuSign API directly (bypassing the SDK) we don't have to specify Doing the Content-Transfer-Encoding as base64 should either be done by default in the same EnvelopesApi method if there's some hidden requirement to use it for that method alone, or it shouldn't be necessary at all. As I pointed out in my MR, #306, the primary problem lies with the handler code for putting the My MR can't work here apparently because you all support as far back as Node v4, which doesn't have |
@andercs Yes, you can ignore the Regarding having it by default in the EnvelopesApi, I am in touch with the engineering team for that specific topic. Thank you. |
@andercs Another way to do it without setting the
Since the endpoint gives you back the file in binary format not in base64 |
@ahmed-shorim-DS at this point, your suggestions are appreciated for the benefit of others, but as we did not receive this more helpful level of support for about two months, we implemented the workaround (as suggested by the technical support staff), deleted any reference to |
@abhim1509 @zero245 Does the above code snippet that I provided help you? |
I'm having the same issue. Using
Thanks @andercs for flagging it, definitely saved me, and @ahmed-shorim-DS for the workaround. |
We are trying to download pdfs, I am sending binary data to frontend, however as soon as we open downloaded pdf, it pops up with error "We cant open this file. Something went wrong".
![MicrosoftTeams-image (10)](https://user-images.githubusercontent.com/43211436/183491419-54c32e49-6071-4ba7-8482-65d8fd9af360.png)
Attaching the screenshots for reference. Kindly provide some suggestions on the _same.
Have already looked in backend example citation and API documentation viz.
https://github.com/docusign/code-examples-node/blob/master/lib/eSignature/examples/envelopeGetDoc.js
#255
https://developers.docusign.com/docs/esign-rest-api/how-to/download-envelope-documents/
sample-documents (13).pdf
The text was updated successfully, but these errors were encountered: