PDf preview not working in SharePoint 2013 search

Tanmoy Das 801 Reputation points

Hi Guys,

For a client, enabled pdf preview using PowerShell.


It worked for the test env but not for Prod. Both the environments are using same office web apps farm.

Any idea? Am I missing anything?

SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,839 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Echo Du_MSFT 17,116 Reputation points

    Hello anonymous user ,

    PDF preview for SharePoint 2013 integrated with Office Web Apps Server isn't enabled by default.
    You could run the below script to enable PDF previews in SharePoint 2013 search results.

    Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue  
    $TenantOwner = Get-SPEnterpriseSearchOwner -Level SSA  
    #Search Service application name  
    $ssa = "Search Service Application"  
    $Rule = Get-SPEnterpriseSearchPropertyRule -PropertyName "FileType" -Operator "IsEqual"  
    $RuleCollection = Get-SPEnterpriseSearchPropertyRuleCollection  
    $Item = New-SPEnterpriseSearchResultItemType -Owner $TenantOwner -SearchApplication $ssa -Name "PDF Preview" -Rules $RuleCollection -RulePriority 1 -DisplayProperties "Title, Author, Size, Path, Description, EditorOWSUSER, LastModifiedTime,CollapsingStatus,DocId,HitHighlightedSummary,HitHighlightedProperties,FileExtension,ViewsLifeTime,ParentLink, ViewsRecent, FileType, IsContainer, SecondaryFileExtension, DisplayAuthor, docaclmeta, ServerRedirectedURL, SectionNames,SectionIndexes,ServerRedirectedEmbedURL, ServerRedirectedPreviewURL" -DisplayTemplateUrl "~sitecollection/_catalogs/masterpage/Display Templates/Search/Item_Word.js" -OptimizeForFrequentUse $true  

    Echo Du


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    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.