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">

UPDATE

Screenshot from Lightning

UPDATE THIS WORK

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

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

Source: https://developer.salesforce.com/blogs/engineering/2014/04/building-content-rich-visualforce-pages-with-salesforce-crm-content.html

2
  • Using thumbnails I would assume
    – Eric
    Aug 24, 2017 at 6:46
  • 1
    This no longer works in a custom Lightning component
    – altius_rup
    Oct 17, 2018 at 18:45

1 Answer 1

1

You are right, it was not easy to find the syntax for it, but I found it. Above you will find my updated code.

You must log in to answer this question.

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