Enable PDF Preview in SharePoint 2013 with Office Web Apps

PDF preview for SharePoint 2013 integrated with Office web apps isn’t enabled by default. Use this below script to enable PDF previews in SharePoint 2013 search results.

SharePoint 2013 office web apps PDF preview:

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

SharePoint 2013 PDF preview in Search results:

sharepoint 2013 office web apps enable pdf preview

SharePoint 2013 enabling PDF previews in document libraries:
Wictor Wilen has written a great tool to enable PDF previews in SharePoint 2013 document libraries with Office Web Apps 2013: https://www.wictorwilen.se/sharepoint-2013-enabling-pdf-previews-in-document-libraries-with-office-web-apps-2013

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

One thought on “Enable PDF Preview in SharePoint 2013 with Office Web Apps

  • Hi. You must connect the Farm to Owa first and bind the WordPdf app

    New-SPWOPIBinding -ServerName OWA.SITE.DOMAIN -Application WordPdf


Leave a Reply