You need to sign in to do that
Don't have an account?
Pawan Kumar 32
How to dispaly content of PDF on VF page.
Hi All,
I want to display content of PDF on vf page. I have stored PDF in Notes & Attachments related list of account object. My requirement is I want to show footer message on Vf Page. Then after I want to show all content of Vf page in PDF(renderAs ="PDF") Here in the below code I am using iframe. But it is not working. It is showing blank. Please help.
I want to display content of PDF on vf page. I have stored PDF in Notes & Attachments related list of account object. My requirement is I want to show footer message on Vf Page. Then after I want to show all content of Vf page in PDF(renderAs ="PDF") Here in the below code I am using iframe. But it is not working. It is showing blank. Please help.
<apex:page controller="ViewPdf" renderAs="PDF"> <iframe src="data:{!att.ContentType};base64,{!pdf}" > <div class="footer"> <div>This document is internal use only</div> </div> </iframe> </apex:page>
public class ViewPdf { public Attachment att { get { if (att == null) { att = [SELECT Body, ContentType, Name FROM Attachment WHERE ID = '00P280000018FlA']; } return att; } private set; } public String pdf { get { return EncodingUtil.Base64Encode(att.body); } } }
Sorry , Missed the actual requirement.
Try this link:
https://help.salesforce.com/articleView?id=000328622&type=1&mode=1 (https://help.salesforce.com/articleView?id=000328622&type=1&mode=1)
Thanks,
Bharath Kumar Thota