I'm implementing an ASP api to do all Docusign API flow (get Login information, get the token, send an envelope to be signed, download a envelope document). Now I'm trying to display a downloaded document in the browser and the document is blank. I'm receiving the document byte content from docusign and trying to render it in a iFrame.
the PDF content sent by docusign is like
%PDF-1.4
%?%Writing objects...
and I have an iframe like this
<iframe name="loadDoc" frameborder="1" height="200" width="800"></iframe>
and I have the following js function:
var htmlText = '<embed width=100% height=100%'
+ ' type="application/pdf"'
+ ' src="data:application/pdf,'
+ PDFdata
+ '"></embed>';
var ifrm = window.frames['loadDoc'].document;
ifrm.open();
ifrm.write(htmlText);
ifrm.close();
how can I get this content and display correctly the PDF content in the iFrame?
Update
If the document has more than 1 page, it's possible to see all pages, all blank...