function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sindhu BandariSindhu Bandari 

how to display a pdf stored in static resource in a visualforce page

how to display a pdf stored in static resource in a visualforce page
Raj VakatiRaj Vakati
Refer this link 

https://salesforce.stackexchange.com/questions/24304/display-pdf-stored-in-static-resources-in-vf-page

https://developer.salesforce.com/forums/?id=906F0000000BPZPIA4

Or use blob 

Refer this link 
https://help.salesforce.com/articleView?id=000044612&language=en_US&type=1
 
<apex:page controller="ViewPdf">
	<iframe src="data:{!att.ContentType};base64,{!pdf}" ></iframe>
</apex:page>

 
Saravanan RajarajanSaravanan Rajarajan
Hi Sindhu,

Use a static resource to display the content of another static resource with the action attribute of the <apex:page> tag. By doing this we can redirect from a Visualforce page to a static resource. Suppose we have a PDF as a static resource (named as helpPdf) and we use that static resource in the action attribute of the <apex:page> tag as follows:

 
<apex:page sidebar="false" showHeader="false" standardStylesheets="false" action="{!URLFOR($Resource.helpPdf)}">
</apex:page>

 
Sindhu BandariSindhu Bandari
hi,

I tried aove way but its directly going to othe page its not displaying at all when i see this in builder (using this visualforce in lighting communities page) it says url no longer exist. can you help me further.

Thanks
Sindhu