I am facing the issue to download/render the blob response in visualforce page with iframe or other alternatives. But i have no luck with any of them. Can any one suggest on this to render/download the blob response as pdf in visualforce page.Got the blob response and parsed it to String as below.
HttpResponse res = http.send(r);
pdfContent = res.getBodyAsBlob(); //Blob property
pdf = EncodingUtil.Base64Encode(pdfContent);//String property
Below is the visualforce code:
<apex:page doctype="html-5.0" controller="ViewDocument" id="thePage" >
<apex:outputPanel id="benefit" rendered="{!showDocument}">
<iframe src="data:application/pdf;base64,{!pdf}" id="theFrame1" width="0%" height ="0%" border="0" scrolling="no" frameborder="0"/>
</apex:outputPanel>
</apex:page>