Hi Friends,
In this post, we are going to learn how to generate a thumbnail/preview of any Document or Video or Image in SharePoint.
Recently I came across a requirement to show some document links on a page but the links should be the thumbnail of the document instead of a plain text(document title). Please find the below approach I followed to achieve this.
getpreview.ashx is a http handler used to generate thumbnail/preview of any document(word,pdf, ppt etc.,), Image and Video which resides in SharePoint.
If you observe in SharePoint search results, when we mouse over on the search results we get a preview of that item. This is actually happening through http handler getpreview.ashx
This handler expects a parameter called “path” which expects absolute path of the doc/image/video. Please find the below sample URLs to generate the thumbnail.
Image:
https://yoursite.com/_layouts/ 15/getpreview.ashx?path=https: //yoursite.com/ PublishingImages/abcd.jpg
Document:
Video:
This handler has also expects a parameter called “resolution” which has a predefined values 1, 2, 3 etc., for different resolutions of previews/Thumbnails. Please find the below sample URLs with different resolutions
Hope this helps…
RELATED POST: Image Renditions in SharePoint 2013
I think this will work only in SharePoint Online and not in SharePoint 2013/2016
ReplyDeleteencodURI for path...
ReplyDelete