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"
$Rule.AddValue("pdf")
$RuleCollection = Get-SPEnterpriseSearchPropertyRuleCollection
$RuleCollection.Add($rule)

$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: http://www.wictorwilen.se/sharepoint-2013-enabling-pdf-previews-in-document-libraries-with-office-web-apps-2013

Salaudeen Rajack

Information Technology Professional with Two decades of SharePoint Experience.

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

  • February 17, 2017 at 4:15 PM

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

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

    Reply

Leave a Reply