How can I show PDF thumbnail images to use in PnP Modern Search on SharePoint?

Jay 0 Reputation points
2026-01-13T19:13:57.2133333+00:00

Problem

I have a SharePoint page which makes use of the PnP web parts. I want search results to show file thumbnails. Word file thumbnails look fine. However, all PDF file thumbnails only show the plain grey preview-image.

The page source shows something like this:

<img alt="preview-image" width="120">

preview-image

Page Setup

The pages uses:

- PnP - Search Box

  • PnP - Search Filters
  • PnP - Search Results

The Search Results web part has these default options in the Layout slots:

  • PreviewImageUrl = AutoPreviewImageUrl
  • PreviewUrl = AutoPreviewUrl

I've used these Layouts on separate pages with the same result:

  • Handlebars/HTML (List)
  • Handlebars/HTML (Cards)

So the PDF thumbnail is not showing. But if I click on the grey preview image, it does open a mini window with the full document.

Microsoft 365 and Office | SharePoint | Development
{count} votes

1 answer

Sort by: Most helpful
  1. Matthew-P 10,835 Reputation points Microsoft External Staff Moderator
    2026-01-14T02:56:01.22+00:00

    Hi Jay

    Welcome to Microsoft Q&A Forum! Have a good day and I hope you're doing well! 

    I completely understand your frustration. Getting thumbnails to display consistently in SharePoint Search results can be quite tricky, and seeing those generic grey icons instead of the actual content is definitely not the desired experience. 

    Based on my research and Microsoft's documentation, the default AutoPreviewImageUrl property is indeed designed to support previews for both Word documents and PDF files automatically.  

    However, I tried to reproduce your issue in my own environment to investigate further. I uploaded 4 files (2 PDFs and 2 Word docs). Interestingly, in my case, 3 files worked perfectly (including both PDFs), but one of my Word documents encountered the exact same issue you described (showing only the grey preview icon). 

    You can see my result here (PDFs are showing thumbnails correctly): 

    User's image

    And here is the Word document that failed to render the thumbnail:   

    User's image

    Since my PDFs are displaying correctly but a Word file is failing, it seems this issue might be related to the specific configuration or indexing status of specific files, rather than a limitation of the PDF format itself.  Before we dive into complex configurations, could you try the following basic troubleshooting steps? 

    1. Browser Cache: Have you tried clearing your browser cache or opening the page in an Incognito/Private window? Sometimes the browser holds onto old cached images. 

    2. Reindex the Library: Sometimes the search crawler might have missed generating the preview for specific files during the initial crawl. If you have admin permissions, have you tried forcing a re-index? You can do this by going to Library Settings > More library settings > Advanced settings > Reindex Document Library. Note that this might take a few hours to take effect.

    3. Test a "Clean" File: Could you try uploading a completely new, simple PDF file (a "fresh" one) to the library, wait about 15 minutes for indexing, and see if that specific one shows up? 

    I hope this gives you some more insights into the problem. Please give those steps a try and let me know the results. I’d be happy to help you dig deeper if the issue persists. If I left anything unclear, feel free to let me know. 

    Kind regards, 


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".    

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.  


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.