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
Akshay PoddarAkshay Poddar 

How to Generate Preview Thumbnail of Attachments Records like PDF, JPEG or Excel in Visualforce ?

I would like to have below functionality created on Visualforce Page, Please help with the solution.

Attachment Preview

SandhyaSandhya (Salesforce Developers) 
Hi,

Below is the sample code.
 
<apex:repeat value="{!Case.attachments}" var="att">
            <apex:panelgrid columns="1">
                <h1>Image/h1>
                <apex:image url="{!URLFOR($Action.Attachment.Download, att.id)}"/>
            </apex:panelgrid>
</apex:repeat>

Refer below link

https://salesforce.stackexchange.com/questions/78756/displaying-attachments-on-visual-force-page
 
https://salesforce.stackexchange.com/questions/69369/thumbnail-images-view-based-on-notes-and-attachments
 
Please mark it as solved if my reply was helpful, it will make it available
for others as a proper solution.

Best Regards,
​Sandhya
 
Akshay PoddarAkshay Poddar

Thanks for your response @Sandhya

But i want thumbnail of files like small picture of files to be shown, i tried the above code and its not working for PDF and other non-image files.

Thanks,
Akshay

 

Bullfrog84Bullfrog84
Is there a lightning equivalent?