Preview of Office Documents (this includes PDF) is a huge benefit when you are searching for information – you can quickly identify if the document is the one you are looking for or skimming/scanning a document efficiently. To get the preview up and running you have to install Office Web Apps 2013 – PDF preview was added in March Public Update 2013 – that’s great, many clients have asked me why there is no support in the 2010 stack. But its 2013 – so let’s install Office Web Apps 2013 for SharePoint 2013!
I did the following steps on my SharePoint 2013 DEV environment. The SP2013 environment was already on March PU because of the awesome AutoSPInstaller/AutoSPSourceBuilder combo. As host I used a virtualized (Hyper-V) Windows Server 2012 with 4 cores and 5gb RAM on my Notebook (Lenovo W520).
You can’t install Office Web Apps on a SharePoint or SQL Server. Additionally the SharePoint Server has to use claims-based authentication. Read all the requirements here.
7 easy steps!
- Install the PreRequisites
- Restart the computer
- Download and install Office Web Apps 2013
- Download and install March Public Update for OWA 2013
- Create the OWA Farm
- Configure the binding on the SharePoint side
- Do a full crawl
PreRequisites for Server 2012
The installer of the Office Web Apps 2013 is a little bit limited – other than the SharePoint 2013 it does not configure the host. But at least you can automate the whole process. Run PowerShell as admin on the OWA server:
Add-WindowsFeature Web-Server, Web-WebServer, Web-Common-Http, Web-Static-Content, Web-App-Dev, Web-Asp-Net, Web-Net-Ext, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Includes, Web-Security, Web-Windows-Auth, Web-Filtering, Web-Stat-Compression, Web-Dyn-Compression, Web-Mgmt-Console, InkAndHandwritingServices, Web-Net-Ext45, Web-Asp-Net45
Restart the computer afterwards.
Download and install Office Web Apps 2013
The installation is quite simple, hit next several times – nothing magic here.
Download and install the March Public Update
After the installation just copy the OWA March 2013 PU on the box and install it. Again, an easy task.
Create the OWA Farm
After installation and patching, we have to use PowerShell again:
New-OfficeWebAppsFarm -InternalURL http://owa2013.demo.com -AllowHttp –EditingEnabled
With New-OfficeWebAppsFarm – you have certainly guessed it – we created the first node of our OWA farm, just replace the internal url with your hostname/FQDN. Because I have a simple DEV environment I did not use https and allowed editing – for editing you need Office licenses, view-only is free (awesome, thanks!). Add the OWA binding on the SharePoint machine, run this in a SharePoint Powershell:
New-SPWOPIBinding -ServerName owa2013.demo.com –AllowHTTP
Set-SPWopiZone -zone "internal-http"
Two commands and the two are coupled – great.
In my opinion seeing the document upfront is huge – a picture worth a thousand words – sooo true! Lets look at the result:
Enable PDF Preview in Search results
Wictor wrote a nice article about how to enable the PDF-Preview – if you followed my guide you do not need to enable it, it’s already set. The only part that is missing is the Display Template.
The quick and dirty Powershell approach to enable PDF Previews in search results:
$tenantOwner = Get-SPEnterpriseSearchOwner -Level SSA
$ssa = "Search Service Application" #adjust if you renamed the service application
$rule = get-SPEnterpriseSearchPropertyRule -PropertyName "FileType" -Operator "IsEqual"
$rule.AddValue( "pdf" )
$ruleCollection = Get-SPEnterpriseSearchPropertyRuleCollection
$item = new-SPEnterpriseSearchResultItemType -Owner $tenantOwner -SearchApplication $ssa -Name "PDF with Preview" -Rules $ruleCollection -RulePriority 1 -DisplayProperties "Title,Author,Size,Path,Description,EditorOWSUSER,LastModifiedTime,CollapsingStatus,DocId,HitHighlightedSummary,HitHighlightedProperties,FileExtension,ViewsLifeTime,P
erverRedirectedPreviewURL" -DisplayTemplateUrl "~sitecollection/_catalogs/masterpage/Display Templates/Search/Item_Word.js" -OptimizeForFrequentUse $true
Do a full crawl
There is one managed property containing the link how to embed the preview of the document – this one is built during a crawl. So just do a full crawl and everything should be set.
If you wanna see the Preview in action, watch the following video:
The Server must be joined to a domain: http://bernado-nguyen-hoan.com/2013/01/22/cant-create-new-office-web-apps-farm-the-server-must-be-joined-to-a-domain/
Install PreReqs for OWA RC: http://blogs.itacs.de/Consulting/Lists/Beitraege/Post.aspx?ID=70
Office Web Apps Powershell cmdlets: http://technet.microsoft.com/en-us/library/jj219457.aspx
Do you like it?
Questions, comments or feedback, just hit the comments!
Max’s free time is spent on twitter (@maxmelcher) mostly with a good coffee in his hands.
Latest posts by Max Melcher (see all)
- How about building a magic mirror?! - March 25, 2017
- SharePoint App, Custom Domain and free SSL certificate - March 25, 2017
- My notes: SharePoint Saturday Munich 2017 #SPSMUC - March 4, 2017