2

In Salesforce lightning in files/notes&attachments of a contact or account you can see a preview of the first page from the pdf. How is that possible?

Here is the code which I extract from the page.

<img src="https://DOMAIN.content.force.com/sfc/servlet.shepherd/version/renditionDownload?rendition=THUMB120BY90&amp;versionId=0688E00000091mE&amp;operationContext=CHATTER&amp;contentId=05T8E0000009v54" class="thumbnailImg medium" alt="PDF">
1
  • 1
    This no longer works in a custom Lightning component
    – altius_rup
    Commented Oct 17, 2018 at 18:45

1 Answer 1

0

You need the version ID of the file. It works perfect for PDF files, just the first page is shown.

<img src="/sfc/servlet.shepherd/version/renditionDownload?rendition=THUMB720BY480&versionId=0688E0000008paMQAQ" 

Source

Screenshot from Lightning

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .