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
Sascha DeinertSascha Deinert 

PDF File preview

in Salesforce lightning in files or Notes/Attachments of a contact or account you can see a preview of the first page from a stored pdf.
How is that possible?

Here is the code which I extract from the page.
<img src=";versionId=0688E00000091mE&amp;operationContext=CHATTER&amp;contentId=05T8E0000009v54" class="thumbnailImg medium" alt="PDF">

User-added image

Mustafa JhabuawalaMustafa Jhabuawala

Behind the scenes lightning framework does this work while uploading the file, some code creates a thumbnail while uploading the file which can be done using some javascript.

There are multiple javascript & jquery plugin available to perform such operations. I cannot say that which plugin or code is used by lightning behind the scenes but this is possible using scripting.

Here is a jQuery plugin for an example (

Hope you find this helpful.